Skip to content

Commit a76bb72

Browse files
Merge pull request #112442 from lgayhardt/appinsightsautocreport0420
App Insights automate-custom-reports update
2 parents 969e4ae + 107abce commit a76bb72

File tree

10 files changed

+26
-32
lines changed

10 files changed

+26
-32
lines changed

articles/azure-monitor/app/automate-custom-reports.md

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ ms.reviewer: sdash
1111

1212
Periodical reports help keep a team informed on how their business critical services are doing. Developers, DevOps/SRE teams, and their managers can be productive with automated reports reliably delivering insights without requiring everyone to sign in the portal. Such reports can also help identify gradual increases in latencies, load or failure rates that may not trigger any alert rules.
1313

14-
Each enterprise has its unique reporting needs, such as:
14+
Each enterprise has its unique reporting needs, such as:
1515

1616
* Specific percentile aggregations of metrics, or custom metrics in a report.
1717
* Have different reports for daily, weekly, and monthly roll-ups of data for different audiences.
18-
* Segmentation by custom attributes like region, or environment.
18+
* Segmentation by custom attributes like region, or environment.
1919
* Group some AI resources together in a single report, even if they may be in different subscriptions or resource groups etc.
2020
* Separate reports containing sensitive metrics sent to selective audience.
2121
* Reports to stakeholders who may not have access to the portal resources.
@@ -34,7 +34,7 @@ You can [programmatically query Application Insights](https://dev.applicationins
3434
![Azure function template](./media/automate-custom-reports/azure-function-template.png)
3535

3636
## Sample query for a weekly digest email
37-
The following query shows joining across multiple datasets for a weekly digest email like report. Customize it as required and use it with any of the options listed above to automate a weekly report.
37+
The following query shows joining across multiple datasets for a weekly digest email like report. Customize it as required and use it with any of the options listed above to automate a weekly report.
3838

3939
```AIQL
4040
let period=7d;
@@ -66,40 +66,34 @@ availabilityResults
6666

6767
## Application Insights scheduled digest report
6868

69-
1. From the Azure portal, select **Create a Resource** > **Compute** > **Function App**.
69+
1. Create an Azure Function App.(Application Insights _On_ is required only if you want to monitor your new Function App with Application Insights)
7070

71-
![Create an Azure Resource Function App screenshot](./media/automate-custom-reports/function-app-01.png)
71+
Visit the Azure Functions documentation to learn how to [create a function app](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function#create-a-function-app)
7272

73-
2. Enter appropriate info for your app and select _Create_. (Application Insights _On_ is required only if you want to monitor your new Function App with Application Insights)
73+
2. Once your new Function App has completed deployment, select **Go to resource**.
7474

75-
![Create an Azure Resource Function App Settings screenshot](./media/automate-custom-reports/function-app-02.png)
75+
3. Select **New function**.
7676

77-
3. Once your new Function App has completed deployment, select **Go to resource**.
77+
![Create a new Function screenshot](./media/automate-custom-reports/new-function.png)
7878

79-
4. Select **New function**.
80-
81-
![Create a new Function screenshot](./media/automate-custom-reports/function-app-03.png)
82-
83-
5. Select the **_Application Insights scheduled digest template_**.
79+
4. Select the **_Application Insights scheduled digest template_**.
8480

8581
> [!NOTE]
86-
> By default, function apps are created with runtime version 2.x. You must [target Azure Functions runtime version](https://docs.microsoft.com/azure/azure-functions/set-runtime-version) **1.x** to use the Application Insights scheduled digest template. ![runtime screenshot](./../../../includes/media/functions-view-update-version-portal/function-app-view-version.png)
87-
88-
82+
> By default, function apps are created with runtime version 3.x. You must [target Azure Functions runtime version](https://docs.microsoft.com/azure/azure-functions/set-runtime-version) **1.x** to use the Application Insights scheduled digest template. Go to Configuration > Function Runtime settings to change the runtime version. ![runtime screenshot](./media/automate-custom-reports/change-runtime-v.png)
8983
9084
![New Function Application Insights Template screenshot](./media/automate-custom-reports/function-app-04.png)
9185

92-
6. Enter an appropriate recipient e-mail address for your report and select **Create**.
86+
5. Enter an appropriate recipient e-mail address for your report and select **Create**.
9387

94-
![Function Settings screenshot](./media/automate-custom-reports/function-app-05.png)
88+
![Function Settings screenshot](./media/automate-custom-reports/scheduled-digest.png)
9589

96-
7. Select your **Function App** > **Platform features** > **Application settings**.
90+
6. Select your **Function App** > **Platform features** > **Configuration**.
9791

98-
![Azure Function Application settings screenshot](./media/automate-custom-reports/function-app-07.png)
92+
![Azure Function Application settings screenshot](./media/automate-custom-reports/config.png)
9993

100-
8. Create three new application settings with appropriate corresponding values ``AI_APP_ID``, ``AI_APP_KEY``, and ``SendGridAPI``. Select **Save**.
94+
7. Create three new application settings with appropriate corresponding values ``AI_APP_ID``, ``AI_APP_KEY``, and ``SendGridAPI``. Select **Save**.
10195

102-
![Function integration interface screenshot](./media/automate-custom-reports/function-app-08.png)
96+
![Function integration interface screenshot](./media/automate-custom-reports/app-settings.png)
10397

10498
(The AI_ values can be found under API Access for the Application Insights Resource you want to report on. If you don't have an Application Insights API Key, there is the option to **Create API Key**.)
10599

@@ -110,39 +104,39 @@ availabilityResults
110104
> [!NOTE]
111105
> If you don't have a SendGrid account you can create one. SendGrid's documentation for Azure Functions is [here](https://docs.microsoft.com/azure/azure-functions/functions-bindings-sendgrid). If just want a minimal explanation of how to setup SendGrid and generate an API key one is provided at the end of this article.
112106
113-
9. Select **Integrate** and under Outputs click **SendGrid ($return)**.
107+
8. Select **Integrate** and under Outputs click **SendGrid ($return)**.
114108

115-
![Output screenshot](./media/automate-custom-reports/function-app-09.png)
109+
![Output screenshot](./media/automate-custom-reports/integrate.png)
116110

117-
10. Under the **SendGridAPI Key App Setting**, select your newly created App Setting for **SendGridAPI**.
111+
9. Under the **SendGridAPI Key App Setting**, select your newly created App Setting for **SendGridAPI**.
118112

119-
![Run Function App screenshot](./media/automate-custom-reports/function-app-010.png)
113+
![Run Function App screenshot](./media/automate-custom-reports/sendgrid-output.png)
120114

121-
11. Run and test your Function App.
115+
10. Run and test your Function App.
122116

123117
![Test Screenshot](./media/automate-custom-reports/function-app-11.png)
124118

125-
12. Check your e-mail to confirm that the message was sent/received successfully.
119+
11. Check your e-mail to confirm that the message was sent/received successfully.
126120

127121
![E-mail subject line screenshot](./media/automate-custom-reports/function-app-12.png)
128122

129123
## SendGrid with Azure
130124

131125
These steps only apply if you don't already have a SendGrid account configured.
132126

133-
1. From the Azure portal select **Create a resource** search for **SendGrid Email Delivery** > Click **Create** > and fill out the SendGrid specific create instructions.
127+
1. From the Azure portal, select **Create a resource** > search for **SendGrid Email Delivery** > click **Create** > fill out the SendGrid specific create instructions.
134128

135-
![Create SendGrid Resource Screenshot](./media/automate-custom-reports/function-app-13.png)
129+
![Create SendGrid Resource Screenshot](./media/automate-custom-reports/sendgrid.png)
136130

137131
2. Once created under SendGrid Accounts select **Manage**.
138132

139-
![Settings API Key Screenshot](./media/automate-custom-reports/function-app-14.png)
133+
![Settings API Key Screenshot](./media/automate-custom-reports/sendgrid-manage.png)
140134

141135
3. This will launch SendGrid's site. Select **Settings** > **API Keys**.
142136

143137
![Create and View API Key App Screenshot](./media/automate-custom-reports/function-app-15.png)
144138

145-
4. Create an API Key > choose **Create & View** (Please review SendGrid's documentation on restricted access to determine what level of permissions is appropriate for your API Key. Full Access is selected here for example purposes only.)
139+
4. Create an API Key > choose **Create & View**. (Review SendGrid's documentation on restricted access to determine what level of permissions is appropriate for your API Key. Full Access is selected here for example purposes only.)
146140

147141
![Full access screenshot](./media/automate-custom-reports/function-app-16.png)
148142

172 KB
Loading
18.2 KB
Loading
118 KB
Loading
82.1 KB
Loading
50.8 KB
Loading
43.6 KB
Loading
51.5 KB
Loading
80.2 KB
Loading
27.7 KB
Loading

0 commit comments

Comments
 (0)