You are on page 1of 3

DevOps Lab

AZURE MONITORING

Application Insights
Home task

This document contains privileged and/or confidential information and may not be
Legal Notice:
disclosed, distributed, or reproduced without the prior written permission of EPAM®.

CONFIDENTIAL | Effective Date: 01-May-21


PREREQUISITES
1. Navigate to https://azuredevopsdemogenerator.azurewebsites.net
2. Sign in using the Microsoft account associated with your Azure DevOps subscription.
3. Select your Azure DevOps organization and enter the project name Parts Unlimited. Click Choose
Template.
4. Select the Parts Unlimited template and click Select Template.
5. Click Create Project and wait for the process to complete.

TASK 1: CREATING AZURE RESOURCES


1. Create Web App with ASP.NET V4.8 runtime stack.
2. Create SQL Database and wait for the process to complete.
3. Allow Azure services and resources to access the created SQL Server.
4. Connect previously created Log Analytics workspaces to Application Insights Instance.

TASK 2: DEPLOYING A WEB APP TO AZURE


1. Open Parts Unlimited project on Azure DevOps.
2. Remove the Dev and QA stages from the existing release pipeline in the project.
3. From the remaining Production stage, complete configuring Azure App Service Deploy task.
4. From the Variables tab, update the WebsiteName variable to reflect the app service name used
to create the Azure app service.
5. Set the trigger that will start the deployment to this stage automatically after release.
6. Run the Build pipeline. Wait for the deployment to complete.
7. Switch to the Azure portal and navigate to the app service created earlier.
8. Copy the Value from the APPINSIGHTS_INSTRUMENTATIONKEY configuration setting.
9. Create a new application setting. Set the Name to Keys:ApplicationInsights:InstrumentationKey
and paste the Value from copied earlier.
10. Create the SQL connection string setting with the name DefaultConnectionString
11. Open Web App URL address

TASK 3: GENERATING AND REVIEWING APPLICATION TRAFFIC


1. Set up an availability test to monitor your web app availability and responsiveness. Define the
logic for triggering an alert whenever the average failed locations are greater than or equal to 1.
2. Create an alert rule using the Kusto query triggered when the number of failed results (5xx) in the
Custom log search query for the last 5 minutes is greater than or equal to 10, evaluated every 5
minutes.
3. Create an alert rule using Metrics triggered when the number of failed results for the last 5
minutes is greater than or equal to 10, evaluated every 1 minute.
4. Create Metric alert for CPU/Memory usage for Service Plan and Web App
5. Create a dashboard with the following metrics (Use metric charts and log views charts):
• Response Time
• Connections
• Memory
• CPU
• Data In/ Data Out
• HTTP Server Errors
• Requests
• Availability
• Total users
• Top 5 URL
6. Create a Workbook with a minimum of 2 metric charts, 2 log views charts.

CONFIDENTIAL | Effective Date: 01-May-21 2


REPORTING
1. Grant a Contributor role permission to your subscription to a Trainer.
2. Share your Dashboard with a Trainer.
3. Upload a pdf file with the screenshot of your Workbook and screenshots of received emails
generated by triggered alert rules to the Homework page at the learn portal as an artifact.

HELPFUL MATERIALS
Azure Application Insights log-based metrics - Azure Monitor | Microsoft Docs
Monitor apps - Azure App Service | Microsoft Docs

CONFIDENTIAL | Effective Date: 01-May-21 3

You might also like