Introduction
In today’s dynamic cloud environments, ensuring system health, performance, and security is critical for delivering seamless digital experiences. Azure Monitor provides a powerful, centralized platform for collecting, analyzing, and acting on telemetry data from applications, infrastructure, and network resources. By deploying and configuring Azure Monitor alongside Log Analytics, organizations can gain deep visibility into their cloud ecosystem, identify trends, and quickly address issues before they impact users.
This article provides a step-by-step guide to deploying and configuring Azure Monitor, setting up Log Analytics, monitoring web applications, tracking compute and networking services, and creating custom alerts. Whether you’re an IT administrator, DevOps engineer, or cloud enthusiast, these practices will help you implement a proactive monitoring strategy that supports business continuity and operational efficiency.
In this project, you’ll explore how to configure monitoring for workloads and infrastructure services using Azure Monitor. This article blends learning with hands-on practice, equipping you with practical skills to strengthen your cloud monitoring strategy.
By the end, you’ll be confident in:
- Deploying and configuring Log Analytics to centralize and analyze logs.
- Configuring monitoring for web applications to ensure performance and availability.
- Monitoring compute and networking services for health, traffic, and resource optimization.
- Configuring alerts to respond quickly to potential issues.
1. Prepare your Azure environment
Prepare your bring-your-own-subscription (BYOS)
This set of lab exercises assumes that you have global administrator permissions to an Azure subscription.
- In the Azure Portal Search Bar, enter Resource Groups and select Resource groups from the list of results.
- On the Resource Groups page, select Create.
- On the Create a Resource Group page, select your subscription and enter the name rg-alpha. Set the region to East US, choose Review + Create, and then choose Create.
[!NOTE] This set of exercises assumes that you choose to deploy in the East US Region, but you can change this to another region if you choose. Just remember that each time you see East US mentioned in these instructions you will need to substitute the region you have chosen.
Create App Log Examiners security group
In this exercise, you create an Entra ID security group.
- In the Azure Portal Search Bar, enter Azure Active Directory (or Entra ID) from the list of results.
- On the Default Directory page, select Groups.
3. On the Groups page, choose New Group.
4. On the New Group page, provide the values in the following table and choose Create.
Property : Value
Group type : Security
Group name : App Log Examiners
Group description : App Log Examiners
Deploy and configure WS-VM1
In this exercise, you deploy and configure a Windows Server virtual machine.
- In the Azure Portal Search Bar, enter Virtual Machines and select Virtual Machines from the list of results.
- On the Virtual Machines page, choose Create and select Azure Virtual Machine.
3. On the Basics page of the Create A Virtual Machine wizard, select the following settings and then choose Review + Create.
4. Review the settings and select Create.
5. Wait for the deployment to complete. Once deployment completes choose Go to resource.
6. On the WS-VM1 properties page, choose Networking.
7. On the Networking page, select the RDP rule.
8. On the RDP rule space, change the Source to My IP address and choose Save.
This restricts incoming RDP connections to the IP address you’re currently using.
9. On the Networking page, choose Add inbound port rule.
10. On the Add inbound security rule page, configure the following settings and choose Add.
11. On the WS-VM1 page, choose Connect.
12. Under Native RDP, choose Select.
13. On the Native RDP page, choose Download RDP file and then open the file.
Opening the RDP file opens the Remote Desktop Connection dialog box.
14. On the Windows Security dialog box, choose More Choices and then choose Use a different account.
15. Enter the username as .\prime and the password as the secure password you chose in Step 3, and choose OK.
16. When signed into the Windows Server virtual machine, right-click on the Start hint and then choose Windows PowerShell (Admin).
17. At the elevated command prompt, type the following command and press Enter. Install-WindowsFeature Web-Server -IncludeAllSubFeature -IncludeManagementTools
18. When the installation completes run the following command to change to the web server root directory. cd c:\inetpub\wwwroot_
_19. Run the following command. Wget https://raw.githubusercontent.com/Azure-Samples/html-docs-hello-world/master/index.html -OutFile index.html
Deploy and configure LX-VM2
In this exercise you deploy and configure a Linux virtual machine.
- In the Azure Portal Search Bar, enter Virtual Machines and select Virtual Machines from the list of results.
- On the Virtual Machines page, choose Create and select Azure Virtual Machine.
3. On the Basics page of the Create A Virtual Machine wizard, select the following settings and then choose Review + Create.
4. Review the information and choose Create.
5. After the VM deploys, open the VM properties page and choose Extensions + Applications under Settings.
6. Choose Add and select the Network Watcher Agent for Linux. Choose Next and then choose Review and Create. Choose Create.
7. Configure the AzureNetworkWatcherExtension and the OmsAgentForLinux extension so that they automatically upgrade.
Deploy a web app with an SQL Database
- Ensure that you’re signed into the Azure Portal.
- In your browser, open a new browser tab and navigate to https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.web/web-app-sql-database 3. On the GitHub page, choose Deploy to Azure. 4. A new tab opens. If necessary, re-sign into Azure with the account that has Global Administrator privileges. 5. On the Basics page, select Edit template.
- In the template editor, delete the contents of lines 158 to 174 inclusive and delete the “,” on line 157. Choose Save.
- On the Basics page, provide the following information and choose Next.
8. Review the information presented and select Create.
9. After the deployment completes, choose Go to resource group.
Deploy a Linux web app
- Ensure that you’re signed into the Azure Portal.
- In your browser, open a new browser tab and navigate to https://learn.microsoft.com/en-us/samples/azure/azure-quickstart-templates/webapp-basic-linux/
- On the GitHub page, choose Deploy to Azure.
- On the Basics page, provide the following information and choose Next.
5. Review the information and choose Create.
2.Deploy Log Analytics
Task 1: Create a Log Analytics workspace
- In the Azure Portal Search Bar, enter Log Analytics and select Log Analytics workspaces from the list of results.
- On the Log Analytics workspaces page, choose Create.
- On the Basics page of the Create Log Analytics workspace wizard, provide the following information and choose Review + Create.
4. Review the information and choose Create.
Task2: Configure Log Analytics data retention and archive policies
- In the Azure Portal Search Bar, enter Log Analytics and select Log Analytics workspaces from the list of results.
- On the Log Analytics workspaces page, choose LogAnalytics1.
- On the Log Analytics workspace page for LogAnalytics1, choose Usage and estimated costs.
- Select Data Retention and set the slider to 60 days. Choose OK.
- On the Log Analytics workspace page for LogAnalytics1, choose Usage and estimated costs.
- Select Daily cap. Choose On. Set the daily cap to 10 GB and choose OK.
Task3: Enable access to a Log Analytics workspace
- In the Azure Portal Search Bar, enter Log Analytics and select Log Analytics workspaces from the list of results.
- On the Log Analytics workspaces page, choose LogAnalytics1.
- Select Access control (IAM).
- Choose Add and then choose Add role assignment.
- On the list of roles, select Log Analytics Reader and choose Next.
- On the Members page, choose Select Members and choose the App Log Examiners security group. Choose Select.
- On the Members space, choose Review + Assign.
3. Monitor web apps
Task1: Enable Application Insights
- In the Azure Portal Search Bar, enter rg-alpha and select rg-alpha from the list of results.
- From the list of items in the resource group, choose App Services for the Web App with an SQL Database.
- Under Settings choose Application Insights.
- On the Application Insights page, choose Turn On Application Insights.
- On the Application Insights page, ensure that Create a new resource is selected and that the Log Analytics Workspace is set to LogAnalytics1 and choose Apply.
- On the Apply monitoring settings dialog, choose Yes.
Tast2: Disable logging for .NET core snapshot debugger
- In the Azure Portal Search Bar, enter rg-alpha and select rg-alpha from the list of results.
- From the list of items in the resource group, choose App Services for the Web App with an SQL Database.
- Under Settings choose Application Insights.
- Under Instrument your application, choose .NET Core and then set the Snapshot Debugger setting to Off. Choose Apply.
- On the Apply Monitoring Settings dialog box, choose Yes.
Task3: Configure web app HTTP logs to be written to a Log Analytics workspace
- In the Azure Portal Search Bar, enter rg-alpha and select rg-alpha from the list of results.
- From the list of items in the resource group, choose App Services for the Web App with an SQL Database.
- Under Monitoring, choose Diagnostic settings.
- On the Diagnostic settings page, select + Add diagnostic settings.
- On the Diagnostic settings page, choose the following and select Save.
Task4: Configure SQL Insights data to be written to a Log Analytics workspace
- In the Azure Portal Search Bar, enter rg-alpha and select rg-alpha from the list of results.
- From the list of items in the resource group, choose the sample SQL database.
- Under Monitoring, choose Diagnostic settings.
- On the Diagnostic settings page, choose Add diagnostic setting.
- On the Diagnostic setting page, provide the following information and choose Save.
Task5: Enable file and configuration change tracking for web apps
- In the Azure Portal Search Bar, enter rg-alpha and select rg-alpha from the list of results.
- From the list of items in the resource group, choose the AzureLinuxAppWXYZ-webapp.
- Choose Diagnose and Solve Problems.
- In the search dialog box, type Application Changes.
- On the Change Analysis page, choose Configure.
- On the Enable file and configuration change tracking page, change the Status slider to On and then choose Save.
4. Configure monitoring for compute services
Task1: Create a data collection endpoint
- In the Azure Portal Search Bar, enter Monitor and select Monitor from the list of results.
- In the Monitor page, under Settings, choose Data Collection Endpoints.
- On the Data Collection Endpoints page, choose Create.
- On the Create Data Collection Endpoint page, provide the following settings and then choose Review + Create.
- Review the settings and choose Create.
 icon.
7. On the Email/SMS message/Push/Voice enable the email checkbox and enter the address prime@fabrikam.com. Choose OK.
8. Choose Review and Create. Choose Create.
Task2: Create an alert for virtual machine CPU utilization
- In the Azure Portal Search Bar, enter rg-alpha and select rg-alpha from the list of results.
- From the list of items in the resource group, choose Linux-VM2.
- On the Linux-VM2 properties page, choose Alerts under Monitoring.
- On the Alerts page, choose Create and then choose Alert rule.
- On the Condition page of the Create an Alert Rule wizard, set the Signal name to Percentage CPU. Use the default settings and choose Next.
- On the Actions page, choose Select Action Group.
- On the Select Action Groups page, choose NotifyCPU and choose Select.
- On the Details page enter the Alert rule name HighCPU. Choose Review and Create and then choose Create.
Conclusion
Effective monitoring is a cornerstone of cloud success. By leveraging Azure Monitor’s integrated tools, IT teams can transform raw telemetry into actionable insights, ensuring that applications remain reliable, scalable, and secure. Configuring Log Analytics provides the foundation for deep analysis, while targeted monitoring of web apps, compute, and networking resources helps maintain optimal performance.
Implementing well-defined alerts ensures rapid response to potential issues, reducing downtime and improving user experience. With this deployment strategy, organizations can shift from reactive troubleshooting to proactive optimization—unlocking the full potential of Microsoft Azure’s cloud ecosystem.
Top comments (0)