Skip to content

Commit 9a055df

Browse files
authored
Merge pull request #164510 from lgayhardt/appinsightsanno0621
App Insights Annotations releaseProperties
2 parents 3a8aa2d + 7800a93 commit 9a055df

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

articles/azure-monitor/app/annotations.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Release annotations for Application Insights | Microsoft Docs
33
description: Learn how to create annotations to track deployment or other significant events with Application Insights.
44
ms.topic: conceptual
5-
ms.date: 05/27/2021
5+
ms.date: 07/02/2021
66

77
---
88

@@ -53,6 +53,25 @@ If you can't use one the deployment tasks in the previous section, then you need
5353
5454
:::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":::
5555
56+
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.
57+
58+
59+
```powershell
60+
-releaseProperties @{
61+
"BuildNumber"="$(Build.BuildNumber)";
62+
"BuildRepositoryName"="$(Build.Repository.Name)";
63+
"BuildRepositoryProvider"="$(Build.Repository.Provider)";
64+
"ReleaseDefinitionName"="$(Build.DefinitionName)";
65+
"ReleaseDescription"="Triggered by $(Build.DefinitionName) $(Build.BuildNumber)";
66+
"ReleaseEnvironmentName"="$(Release.EnvironmentName)";
67+
"ReleaseId"="$(Release.ReleaseId)";
68+
"ReleaseName"="$(Release.ReleaseName)";
69+
"ReleaseRequestedFor"="$(Release.RequestedFor)";
70+
"ReleaseWebUrl"="$(Release.ReleaseWebUrl)";
71+
"SourceBranch"="$(Build.SourceBranch)";
72+
"TeamFoundationCollectionUri"="$(System.TeamFoundationCollectionUri)" }
73+
```
74+
5675
1. Save.
5776
5877
## Create release annotations with Azure CLI
@@ -99,6 +118,7 @@ You can use the CreateReleaseAnnotation PowerShell script to create annotations
99118
|releaseName | The name to give the created release annotation. | |
100119
|releaseProperties | Used to attach custom metadata to the annotation. | Optional|
101120
121+
102122
## View annotations
103123
104124
> [!NOTE]
@@ -149,7 +169,7 @@ You only need to install the extension once for your Azure DevOps organization.
149169
150170
Create a separate API key for each of your Azure Pipelines release templates.
151171
152-
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](./app-insights-overview.md).
172+
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).
153173
154174
1. Open the **API Access** tab and copy the **Application Insights ID**.
155175

0 commit comments

Comments
 (0)