You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/annotations.md
+76-77Lines changed: 76 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,16 @@ ms.reviewer: casocha
9
9
10
10
# Release annotations for Application Insights
11
11
12
-
Annotations show where you deployed a new build, or other significant events. Annotations make it easy to see whether your changes had any effect on your application's performance. They can be automatically created by the [Azure Pipelines](/azure/devops/pipelines/tasks/) build system. You can also create annotations to flag any event you like by creating them from PowerShell.
12
+
Annotations show where you deployed a new build or other significant events. Annotations make it easy to see whether your changes had any effect on your application's performance. They can be automatically created by the [Azure Pipelines](/azure/devops/pipelines/tasks/) build system. You can also create annotations to flag any event you want by creating them from PowerShell.
13
13
14
14
## Release annotations with Azure Pipelines build
15
15
16
16
Release annotations are a feature of the cloud-based Azure Pipelines service of Azure DevOps.
17
17
18
18
If all the following criteria are met, the deployment task creates the release annotation automatically:
19
19
20
-
- The resource you're deploying to is linked to Application Insights (via the `APPINSIGHTS_INSTRUMENTATIONKEY` app setting).
21
-
- The Application Insights resource is in the same subscription as the resource you're deploying to.
20
+
- The resource to which you're deploying is linked to Application Insights via the `APPINSIGHTS_INSTRUMENTATIONKEY` app setting.
21
+
- The Application Insights resource is in the same subscription as the resource to which you're deploying.
22
22
- You're using one of the following Azure DevOps pipeline tasks:
23
23
24
24
| Task code | Task name | Versions |
@@ -31,19 +31,21 @@ If all the following criteria are met, the deployment task creates the release a
31
31
| AzureWebApp | Azure Web App | Any |
32
32
33
33
> [!NOTE]
34
-
> If you’re still using the Application Insights annotation deployment task, you should delete it.
34
+
> If you're still using the Application Insights annotation deployment task, you should delete it.
35
35
36
36
### Configure release annotations
37
37
38
-
If you can't use one the deployment tasks in the previous section, then you need to add an inline script task in your deployment pipeline.
38
+
If you can't use one of the deployment tasks in the previous section, you need to add an inline script task in your deployment pipeline.
39
39
40
-
1. Navigate to a new or existing pipeline and select a task.
41
-
:::image type="content" source="./media/annotations/task.png" alt-text="Screenshot of task in stages selected." lightbox="./media/annotations/task.png":::
40
+
1. Go to a new or existing pipeline and select a task.
41
+
42
+
:::image type="content" source="./media/annotations/task.png" alt-text="Screenshot that shows a task selected under Stages." lightbox="./media/annotations/task.png":::
42
43
1. Add a new task and select **Azure CLI**.
43
-
:::image type="content" source="./media/annotations/add-azure-cli.png" alt-text="Screenshot of adding a new task and selecting Azure CLI." lightbox="./media/annotations/add-azure-cli.png":::
44
-
1. Specify the relevant Azure subscription. Change the **Script Type** to *PowerShell* and **Script Location** to *Inline*.
45
-
1. Add the [PowerShell script from step 2 in the next section](#create-release-annotations-with-azure-cli) to **Inline Script**.
46
-
1. Add the arguments below, replacing the angle-bracketed placeholders with your values to **Script Arguments**. The -releaseProperties are optional.
44
+
45
+
:::image type="content" source="./media/annotations/add-azure-cli.png" alt-text="Screenshot that shows adding a new task and selecting Azure CLI." lightbox="./media/annotations/add-azure-cli.png":::
46
+
1. Specify the relevant Azure subscription. Change **Script Type** to **PowerShell** and **Script Location** to **Inline**.
47
+
1. Add the [PowerShell script from step 2 in the next section](#create-release-annotations-with-the-azure-cli) to **Inline Script**.
48
+
1. Add the following arguments. Replace the angle-bracketed placeholders with your values to **Script Arguments**. The `-releaseProperties` are optional.
47
49
48
50
```powershell
49
51
-aiResourceId "<aiResourceId>" `
@@ -54,8 +56,7 @@ If you can't use one the deployment tasks in the previous section, then you need
54
56
55
57
:::image type="content" source="./media/annotations/inline-script.png" alt-text="Screenshot of Azure CLI task settings with Script Type, Script Location, Inline Script, and Script Arguments highlighted." lightbox="./media/annotations/inline-script.png":::
56
58
57
-
Below is an example of metadata you can set in the optional releaseProperties argument using [build](/azure/devops/pipelines/build/variables#build-variables-devops-services) and [release](/azure/devops/pipelines/release/variables#default-variables---release) variables.
58
-
59
+
The following example shows metadata you can set in the optional `releaseProperties` argument by using [build](/azure/devops/pipelines/build/variables#build-variables-devops-services) and [release](/azure/devops/pipelines/release/variables#default-variables---release) variables.
59
60
60
61
```powershell
61
62
-releaseProperties @{
@@ -73,15 +74,15 @@ If you can't use one the deployment tasks in the previous section, then you need
You can use the CreateReleaseAnnotation PowerShell script to create annotations from any process you like, without using Azure DevOps.
81
+
You can use the `CreateReleaseAnnotation` PowerShell script to create annotations from any process you want without using Azure DevOps.
81
82
82
-
1. Sign into [Azure CLI](/cli/azure/authenticate-azure-cli).
83
+
1. Sign in to the [Azure CLI](/cli/azure/authenticate-azure-cli).
83
84
84
-
2. Make a local copy of the script below and call it CreateReleaseAnnotation.ps1.
85
+
1. Make a local copy of the following script and call it `CreateReleaseAnnotation.ps1`.
85
86
86
87
```powershell
87
88
param(
@@ -105,10 +106,10 @@ You can use the CreateReleaseAnnotation PowerShell script to create annotations
105
106
# Invoke-AzRestMethod -Path "$aiResourceId/Annotations?api-version=2015-05-01" -Method PUT -Payload $body
106
107
```
107
108
108
-
[!NOTE]
109
-
Your annotations must have **Category** set to **Deployment** in order to be displayed in the Azure Portal.
109
+
> [!NOTE]
110
+
> Your annotations must have **Category** set to **Deployment** to appear in the Azure portal.
110
111
111
-
3. Call the PowerShell script with the following code, replacing the angle-bracketed placeholders with your values. The -releaseProperties are optional.
112
+
1. Call the PowerShell script with the following code. Replace the angle-bracketed placeholders with your values. The `-releaseProperties` are optional.
112
113
113
114
```powershell
114
115
.\CreateReleaseAnnotation.ps1 `
@@ -118,111 +119,109 @@ You can use the CreateReleaseAnnotation PowerShell script to create annotations
|aiResourceId | The Resource ID to the target Application Insights resource. | Example:<br> /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRGName/providers/microsoft.insights/components/MyResourceName|
124
-
|releaseName | The name to give the created release annotation. | |
125
-
|releaseProperties | Used to attach custom metadata to the annotation. | Optional|
|`aiResourceId` | The resource ID to the target Application Insights resource. | Example:<br> /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRGName/providers/microsoft.insights/components/MyResourceName|
125
+
|`releaseName` | The name to give the created release annotation. | |
126
+
|`releaseProperties` | Used to attach custom metadata to the annotation. | Optional|
127
+
128
128
## View annotations
129
129
130
130
> [!NOTE]
131
-
> Release annotations are not currently available in the Metrics pane of Application Insights
131
+
> Release annotations aren't currently available in the **Metrics** pane of Application Insights.
132
132
133
-
Now, whenever you use the release template to deploy a new release, an annotation is sent to Application Insights. The annotations can be viewed in the following locations:
133
+
Whenever you use the release template to deploy a new release, an annotation is sent to Application Insights. You can view annotations in the following locations:
134
134
135
-
- Performance
135
+
- **Performance:**
136
136
137
-
:::image type="content" source="./media/annotations/performance.png" alt-text="Screenshot of the Performance tab with a release annotation selected(blue arrow) to show the Release Properties tab." lightbox="./media/annotations/performance.png":::
137
+
:::image type="content" source="./media/annotations/performance.png" alt-text="Screenshot that shows the Performance tab with a release annotation selected to show the Release Properties tab." lightbox="./media/annotations/performance.png":::
138
138
139
-
- Failures
139
+
- **Failures:**
140
140
141
-
:::image type="content" source="./media/annotations/failures.png" alt-text="Screenshot of the Failures tab with a release annotation (blue arrow) selected to show the Release Properties tab." lightbox="./media/annotations/failures.png":::
142
-
- Usage
141
+
:::image type="content" source="./media/annotations/failures.png" alt-text="Screenshot that shows the Failures tab with a release annotation selected to show the Release Properties tab." lightbox="./media/annotations/failures.png":::
142
+
- **Usage:**
143
143
144
-
:::image type="content" source="./media/annotations/usage-pane.png" alt-text="Screenshot of the Users tab bar with release annotations selected. Release annotations appear as blue arrows above the chart indicating the moment in time that a release occurred." lightbox="./media/annotations/usage-pane.png":::
144
+
:::image type="content" source="./media/annotations/usage-pane.png" alt-text="Screenshot that shows the Users tab bar with release annotations selected. Release annotations appear as blue arrows above the chart indicating the moment in time that a release occurred." lightbox="./media/annotations/usage-pane.png":::
145
145
146
-
- Workbooks
146
+
- **Workbooks:**
147
147
148
-
In any log-based workbook query where the visualization displays time along the x-axis.
148
+
In any log-based workbook query where the visualization displays time along the x-axis:
149
149
150
-
:::image type="content" source="./media/annotations/workbooks-annotations.png" alt-text="Screenshot of workbooks pane with time series log-based query with annotations displayed." lightbox="./media/annotations/workbooks-annotations.png":::
150
+
:::image type="content" source="./media/annotations/workbooks-annotations.png" alt-text="Screenshot that shows the Workbooks pane with a time series log-based query with annotations displayed." lightbox="./media/annotations/workbooks-annotations.png":::
151
151
152
-
To enable annotations in your workbook, go to **Advanced Settings** and select **Show annotations**.
152
+
To enable annotations in your workbook, go to **Advanced Settings** and select **Show annotations**.
153
153
154
-
:::image type="content" source="./media/annotations/workbook-show-annotations.png" alt-text="Screenshot of Advanced Settings menu with the show annotations checkbox highlighted.":::
154
+
:::image type="content" source="./media/annotations/workbook-show-annotations.png" alt-text="Screenshot that shows the Advanced Settings menu with the show annotations checkbox highlighted.":::
155
155
156
156
Select any annotation marker to open details about the release, including requestor, source control branch, release pipeline, and environment.
157
157
158
-
## Release annotations using API keys
158
+
## Release annotations by using API keys
159
159
160
160
Release annotations are a feature of the cloud-based Azure Pipelines service of Azure DevOps.
161
161
162
162
> [!IMPORTANT]
163
-
> Annotations using API keys is deprecated. We recommend using [Azure CLI](#create-release-annotations-with-azure-cli) instead.
163
+
> Annotations using API keys is deprecated. We recommend using the [Azure CLI](#create-release-annotations-with-the-azure-cli) instead.
164
164
165
165
### Install the annotations extension (one time)
166
166
167
-
To be able to create release annotations, you'll need to install one of the many Azure DevOps extensions available in the Visual Studio Marketplace.
167
+
To create release annotations, install one of the many Azure DevOps extensions available in Visual Studio Marketplace.
168
168
169
169
1. Sign in to your [Azure DevOps](https://azure.microsoft.com/services/devops/) project.
170
-
171
-
1. On the Visual Studio Marketplace [Release Annotations extension](https://marketplace.visualstudio.com/items/ms-appinsights.appinsightsreleaseannotations) page, select your Azure DevOps organization, and then select **Install** to add the extension to your Azure DevOps organization.
172
-
173
-

174
-
170
+
171
+
1. On the **Visual Studio Marketplace** [Release Annotations extension](https://marketplace.visualstudio.com/items/ms-appinsights.appinsightsreleaseannotations) page, select your Azure DevOps organization. Select **Install** to add the extension to your Azure DevOps organization.
172
+
173
+

174
+
175
175
You only need to install the extension once for your Azure DevOps organization. You can now configure release annotations for any project in your organization.
176
176
177
-
### Configure release annotations using API keys
177
+
### Configure release annotations by using API keys
178
178
179
179
Create a separate API key for each of your Azure Pipelines release templates.
180
180
181
181
1. Sign in to the [Azure portal](https://portal.azure.com) and open the Application Insights resource that monitors your application. Or if you don't have one, [create a new Application Insights resource](create-workspace-resource.md).
182
-
182
+
183
183
1. Open the **API Access** tab and copy the **Application Insights ID**.
184
-
185
-

184
+
185
+

186
186
187
187
1. In a separate browser window, open or create the release template that manages your Azure Pipelines deployments.
188
+
189
+
1. Select **Add task** and then select the **Application Insights Release Annotation** task from the menu.
188
190
189
-
1. Select **Add task**, and then select the **Application Insights Release Annotation** task from the menu.
190
-
191
-

191
+

192
192
193
193
> [!NOTE]
194
-
> The Release Annotation task currently supports only Windows-based agents; it won't run on Linux, macOS, or other types of agents.
195
-
194
+
> The Release Annotation task currently supports only Windows-based agents. It won't run on Linux, macOS, or other types of agents.
195
+
196
196
1. Under **Application ID**, paste the Application Insights ID you copied from the **API Access** tab.
197
-
198
-

199
-
200
-
1. Back in the Application Insights **API Access** window, select **Create API Key**.
201
-
202
-

203
-
204
-
1. In the **Create API key** window, type a description, select **Write annotations**, and then select **Generate key**. Copy the new key.
205
-
206
-

207
-
197
+
198
+

199
+
200
+
1. Back in the Application Insights **API Access** window, select **Create API Key**.
201
+
202
+

203
+
204
+
1. In the **Create API key** window, enter a description, select **Write annotations**, and then select **Generate key**. Copy the new key.
205
+
206
+

207
+
208
208
1. In the release template window, on the **Variables** tab, select **Add** to create a variable definition for the new API key.
209
209
210
-
1. Under **Name**, enter `ApiKey`, and under **Value**, paste the API key you copied from the **API Access** tab.
211
-
212
-

213
-
214
-
1. Select **Save** in the main release template window to save the template.
210
+
1. Under **Name**, enter **ApiKey**. Under **Value**, paste the API key you copied from the **API Access** tab.
215
211
212
+

213
+
214
+
1. Select **Save** in the main release template window to save the template.
216
215
217
216
> [!NOTE]
218
217
> Limits for API keys are described in the [REST API rate limits documentation](/rest/api/yammer/rest-api-rate-limits).
219
218
220
219
### Transition to the new release annotation
221
220
222
-
To use the new release annotations:
221
+
To use the new release annotations:
223
222
1. [Remove the Release Annotations extension](/azure/devops/marketplace/uninstall-disable-extensions).
224
-
1. Remove the Application Insights Release Annotation task in your Azure Pipelines deployment.
225
-
1. Create new release annotations with [Azure Pipelines](#release-annotations-with-azure-pipelines-build) or [Azure CLI](#create-release-annotations-with-azure-cli).
223
+
1. Remove the Application Insights Release Annotation task in your Azure Pipelines deployment.
224
+
1. Create new release annotations with [Azure Pipelines](#release-annotations-with-azure-pipelines-build) or the [Azure CLI](#create-release-annotations-with-the-azure-cli).
0 commit comments