Task 03 - Monitoring with Application Insights (20 minutes)
Introduction
To wrap up the DevOps journey, Munson’s Pickles and Preserves would like to understand what is happening in their deployed environments. By the time users complain about a problem, it is already too late. It is also imperative to know not only about the performance of the site, but also the impact–positive or negative–a feature has had on the users. Please take a moment to review the articles in the Learning Resources section to gain a better understanding of the importance of monitoring, as well as Application Insights, one of the tools available in Azure to make monitoring easy.
Description
In this task, we will look at some of the telemetry that Application Insights has already collected from our running instances. This information is available because we enabled data collection during Exercise 03.
- Review the
main.bicep
file. Find where the Application Insights node was created and note how the Web App was configured to send its logs there. - Create a dashboard in the Azure Portal to provide a summary of the status of our site. (hint)
- Implement an outside-in availability test for the homepage of your site. (hint)
Success Criteria
- You should understand the importance of monitoring and some of the basic features offered by Application Insights.
We are just scratching the surface of what is offered in Azure Monitoring, if you are interested in learning more there is a full What the Hack focused on Azure Monitoring.
Learning Resources
Solution
Expand this section to view the solution
-
The App Insights Instrumentation key property is defined here under the appServiceApp resource
-
The App Insights resource is deployed here in the Bicep script
-
Go to Application Insights and select Application Dashboard.
-
Select Edit to explore what kinds of changes and updates you can make to the default dashboard.
-
After making a few changes, name your new custom dashboard and select Save to save it.
-
Your new custom dashboard is now visible. It is also the new default dashboard for App Services.
-
Choose Add Classic test for your production site.
- Repeat the process for your dev and test sites as well.
-
After a few minutes, you’ll start seeing data coming in.
-
To see what happens when an app in unavailable, turn off one of your apps.
-
If you want alerts based on the site availability, select the ellipsis (…) by the test and select Open rules (Alerts) page.
-
There will be a default alert created for failed applications. You can also select + Create if you want add additional rules.
- Continue exploring and creating additional alerts as desired.