Lab: Exploring Azure Monitoring & Governance Tools
Describe monitoring tools in Azure
Lab: Exploring Azure Monitoring & Governance Tools
This hands-on lab introduces you to the core monitoring and advisory tools in Microsoft Azure: Azure Monitor, Azure Service Health, and Azure Advisor. You will deploy a basic resource to observe how Azure collects telemetry and provides optimization recommendations.
[!WARNING] Always run the commands in the Teardown section at the end of this lab to avoid unexpected charges to your Azure account.
Prerequisites
- Azure Subscription: An active Azure free account or a sandbox subscription.
- Interface: Azure Cloud Shell (Bash) or Azure CLI installed locally.
- Permissions: Contributor or Owner role on the subscription to create resource groups and storage accounts.
Learning Objectives
- Deploy an Azure Storage Account via CLI to generate resource data.
- Access Azure Monitor to view real-time metrics and telemetry.
- Utilize Azure Service Health to identify regional outages or planned maintenance.
- Interpret Azure Advisor recommendations for cost, security, and performance.
Architecture Overview
In this lab, you will interact with the monitoring plane of Azure. The following diagram illustrates how telemetry flows from your resources into the management tools.
Step-by-Step Instructions
Step 1: Create a Resource Group and Storage Account
To see monitoring in action, we need a resource to monitor. We will create a storage account because it generates immediate metrics.
# Replace <YOUR_REGION> with a region like 'eastus'
az group create --name brainybee-monitor-lab-rg --location <YOUR_REGION>
# Create the storage account (name must be globally unique)
az storage account create \
--name brainybeelab$RANDOM \
--resource-group brainybee-monitor-lab-rg \
--location <YOUR_REGION> \
--sku Standard_LRS▶Console alternative
- Search for Storage accounts in the top search bar.
- Click + Create.
- Create a new Resource Group:
brainybee-monitor-lab-rg. - Storage account name:
brainybeelab+ a random number. - Region: Pick any (e.g., East US).
- Click Review + create, then Create.
Step 2: Explore Azure Monitor Metrics
Azure Monitor collects performance data (metrics) from your resources automatically.
# List the metrics available for your storage account
az monitor metrics list-definitions --resource "/subscriptions/<YOUR_SUBSCRIPTION_ID>/resourceGroups/brainybee-monitor-lab-rg/providers/Microsoft.Storage/storageAccounts/<YOUR_STORAGE_ACCOUNT_NAME>"[!TIP] In the CLI, use
az account show --query id -o tsvto find your Subscription ID.
▶Console alternative
- Open your new Storage Account in the portal.
- On the left menu, scroll to the Monitoring section and select Metrics.
- Under Metric, select Used Capacity or Transactions.
- Observe the chart (it may be flat as the resource is new).
Step 3: Check Azure Service Health
Service Health tracks the status of Azure services globally and in your specific regions.
▶Console/Portal View (Recommended)
- In the Azure Portal search bar, type Service Health.
- Click Service issues on the left to see current outages.
- Click Planned maintenance to see upcoming work that might affect your resources.
- Click Health history to see past incidents.
Step 4: Review Azure Advisor Recommendations
Azure Advisor analyzes your configurations and suggests improvements based on best practices.
# List all recommendations (Note: New accounts may have empty results for 24 hours)
az advisor recommendation list▶Console alternative
- Search for Advisor in the portal.
- View the Overview dashboard.
- Click into Cost or Security to see specific suggestions.
Visualizing the Monitoring Stack
The following diagram shows the logical relationship between logs, metrics, and the monitoring interfaces.
\begin{tikzpicture} [node distance=2cm, box/.style={rectangle, draw, fill=blue!10, text width=2.5cm, align=center, minimum height=1cm}]
\node [box] (data) {Resource Telemetry$Logs & Metrics)}; \node [box, right=of data] (monitor) {Azure Monitor$Central Hub)}; \node [box, above right=0.5cm and 2cm of monitor] (insights) {Application Insights}; \node [box, below right=0.5cm and 2cm of monitor] (analytics) {Log Analytics};
\draw [->, thick] (data) -- (monitor); \draw [->, dashed] (monitor) -- (insights); \draw [->, dashed] (monitor) -- (analytics);
\node [below=1cm of monitor, font=\small, italic] {Action: Alerts, Dashboards, Scaling}; \end{tikzpicture}
Checkpoints
| Checkpoint | Expected Result |
|---|---|
| Resource Creation | az storage account show returns a JSON object with provisioningState: Succeeded. |
| Azure Monitor | The Portal Metrics chart shows at least one data point for 'Used Capacity'. |
| Service Health | The dashboard displays "No service issues found" for your selected region. |
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| "ResourceNotFound" | CLI commands used incorrect resource group or account name. | Run az storage account list -o table to verify names. |
| Advisor is empty | Recommendations take up to 24 hours to generate for new resources. | Check back after 24 hours or look at the 'Security' tab for default policy items. |
| Metrics show no data | The storage account is idle and has no traffic. | Upload a small file via the portal 'Containers' section to trigger a transaction. |
Teardown
To ensure you are not charged for the resources created during this lab, delete the resource group.
az group delete --name brainybee-monitor-lab-rg --yes --no-wait[!IMPORTANT] The
--no-waitflag allows the command to return immediately while Azure deletes the resources in the background.