Release and work item insights for Application Insights - Azure Monitor (2024)

  • Article

Release and work item insights are crucial for optimizing the software development lifecycle. As applications evolve, it's vital to monitor each release and its work items closely. These insights highlight performance bottlenecks and let teams address issues proactively, ensuring smooth deployment and user experience. They equip developers and stakeholders to make decisions, adjust processes, and deliver high-quality software.

  • Continuous monitoring
  • Release annotations
  • Work item integration

Azure Pipelines integrates with Application Insights to allow continuous monitoring of your Azure DevOps release pipeline throughout the software development lifecycle.

With continuous monitoring, release pipelines can incorporate monitoring data from Application Insights and other Azure resources. When the release pipeline detects an Application Insights alert, the pipeline can gate or roll back the deployment until the alert is resolved. If all checks pass, deployments can proceed automatically from test all the way to production, without the need for manual intervention.

Configure continuous monitoring

  1. In Azure DevOps, select an organization and project.

  2. On the left menu of the project page, select Pipelines > Releases.

  3. Select the dropdown arrow next to New and select New release pipeline. Or, if you don't have a pipeline yet, select New pipeline on the page that appears.

  4. On the Select a template pane, search for and select Azure App Service deployment with continuous monitoring, and then select Apply.

  5. In the Stage 1 box, select the hyperlink to View stage tasks.

  6. In the Stage 1 configuration pane, fill in the following fields:

    ParameterValue
    Stage nameProvide a stage name or leave it at Stage 1.
    Azure subscriptionSelect the dropdown arrow and select the linked Azure subscription you want to use.
    App typeSelect the dropdown arrow and select your app type.
    App Service nameEnter the name of your Azure App Service.
    Resource Group name for Application InsightsSelect the dropdown arrow and select the resource group you want to use.
    Application Insights resource nameSelect the dropdown arrow and select the Application Insights resource for the resource group you selected.
  7. To save the pipeline with default alert rule settings, select Save in the upper-right corner of the Azure DevOps window. Enter a descriptive comment and select OK.

Modify alert rules

Out of the box, the Azure App Service deployment with continuous monitoring template has four alert rules: Availability, Failed requests, Server response time, and Server exceptions. You can add more rules or change the rule settings to meet your service level needs.

To modify alert rule settings:

In the left pane of the release pipeline page, select Configure Application Insights Alerts.

The four default alert rules are created via an Inline script:

$subscription = az account show --query "id";$subscription.Trim("`"");$resource="/subscriptions/$subscription/resourcegroups/"+"$(Parameters.AppInsightsResourceGroupName)"+"/providers/microsoft.insights/components/" + "$(Parameters.ApplicationInsightsResourceName)";az monitor metrics alert create -n 'Availability_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'avg availabilityResults/availabilityPercentage < 99' --description "created from Azure DevOps";az monitor metrics alert create -n 'FailedRequests_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'count requests/failed > 5' --description "created from Azure DevOps";az monitor metrics alert create -n 'ServerResponseTime_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'avg requests/duration > 5' --description "created from Azure DevOps";az monitor metrics alert create -n 'ServerExceptions_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'count exceptions/server > 5' --description "created from Azure DevOps";

You can modify the script and add more alert rules. You can also modify the alert conditions. And you can remove alert rules that don't make sense for your deployment purposes.

Add deployment conditions

When you add deployment gates to your release pipeline, an alert that exceeds the thresholds you set prevents unwanted release promotion. After you resolve the alert, the deployment can proceed automatically.

To add deployment gates:

  1. On the main pipeline page, under Stages, select the Pre-deployment conditions or Post-deployment conditions symbol, depending on which stage needs a continuous monitoring gate.

  2. In the Pre-deployment conditions configuration pane, set Gates to Enabled.

  3. Next to Deployment gates, select Add.

  4. Select Query Azure Monitor alerts from the dropdown menu. This option lets you access both Azure Monitor and Application Insights alerts.

  5. Under Evaluation options, enter the values you want for settings like The time between re-evaluation of gates and The timeout after which gates fail.

View release logs

You can see deployment gate behavior and other release steps in the release logs. To open the logs:

  1. Select Releases from the left menu of the pipeline page.

  2. Select any release.

  3. Under Stages, select any stage to view a release summary.

  4. To view logs, select View logs in the release summary, select the Succeeded or Failed hyperlink in any stage, or hover over any stage and select Logs.

See also

  • Azure Pipelines documentation
  • Create work items
  • Automation with PowerShell
  • Availability test

Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

Submit and view feedback for

Release and work item insights for Application Insights - Azure Monitor (2024)
Top Articles
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 6401

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.