Why Monitoring Matters
Deploying resources to Azure is just the beginning. Once your workloads are running, you need to:
-
Know when something breaks
-
Understand performance and usage patterns
-
Detect security threats
-
Optimize costs
-
Get recommendations for improvement
Azure provides a suite of tools to monitor, manage, and optimize your cloud environment.
1. Azure Monitor
What Is It?
Azure Monitor is the central monitoring platform in Azure. It collects, analyzes, and acts on telemetry data from your Azure resources, on-premises systems, and other clouds.
Data Sources:
Azure VMs, Databases, Web Apps, Networks, Applications
On-premises servers (via Azure Monitor Agent)
│
▼
Azure Monitor (Collect → Analyze → Act)
├── Metrics → Numerical time-series data (CPU%, memory, requests)
├── Logs → Text-based event and diagnostic data
└── Traces → End-to-end request tracking through apps
│
▼
Alerts → Dashboards → Workbooks → Reports
Key Components of Azure Monitor
|
Component |
Description |
|---|---|
|
Metrics |
Numerical data points collected every minute (CPU%, disk I/O, requests/sec) |
|
Logs |
Query-able structured data (events, errors, traces) via Log Analytics |
|
Alerts |
Notify or trigger actions when thresholds are breached |
|
Dashboards |
Visual display of metrics and logs |
|
Workbooks |
Interactive reports combining data, text, and visualizations |
|
Insights |
Pre-built monitoring experiences for VMs, containers, apps |
Azure Monitor Alerts
You can configure alerts to notify you when something unusual happens:
Alert Rule: "CPU on VM > 90% for 5 minutes"
↓
Alert fires
↓
Action Group triggered:
├── Send email to: ops-team@company.com
├── Send SMS to: +1-555-0100
└── Trigger Azure Function to auto-scale
Alert Types
|
Alert Type |
Based On |
|---|---|
|
Metric alert |
Numeric threshold (CPU > 80%) |
|
Log alert |
Log query result (errors > 10 in last 5 min) |
|
Activity log alert |
Someone deleted a resource, policy changed |
|
Smart detection |
AI-detected anomalies in Application Insights |
2. Log Analytics
What Is It?
Log Analytics (part of Azure Monitor) is a tool for querying and analyzing log data collected from Azure resources, VMs, applications, and more.
Logs are queried using Kusto Query Language (KQL) — a powerful query language similar to SQL.
Example KQL Query
// Find all errors in the last hour
AzureDiagnostics
| where TimeGenerated > ago(1h)
| where Level == "Error"
| project TimeGenerated, Resource, Message
| order by TimeGenerated desc
Log Analytics Workspace
All log data flows into a Log Analytics Workspace — a central store you can query:
VM Logs ──┐
App Logs ├──→ Log Analytics Workspace ──→ Query with KQL
DB Logs ─┘
What You Can Analyze
-
Error rates in web applications
-
Failed login attempts (security)
-
VM performance over time
-
Network traffic patterns
-
Container logs from AKS
3. Application Insights
What Is It?
Application Insights (part of Azure Monitor) is an Application Performance Management (APM) service for web applications. It monitors your live application, automatically detects performance anomalies, and includes powerful analytics tools.
What Application Insights Tracks
|
Metric |
Description |
|---|---|
|
Request rates |
How many requests per second |
|
Response times |
How long each request takes |
|
Failure rates |
Percentage of requests that fail |
|
Dependency calls |
Calls to databases, APIs, external services |
|
Exception tracking |
Unhandled errors and exceptions |
|
User behavior |
Page views, sessions, users |
|
Custom events |
Events you define in your code |
Application Map
Application Insights generates a visual Application Map showing all components of your app and their health:
Web App → SQL Database (avg 12ms) ✓
→ Redis Cache (avg 1ms) ✓
→ Payment API (avg 450ms) ⚠ Slow!
→ Email Service (2% fail) ✗ Errors!
4. Azure Advisor
What Is It?
Azure Advisor is a personalized cloud consultant that analyzes your Azure usage and configuration, then provides actionable recommendations to help you optimize your resources.
Think of it as a smart advisor that reads your Azure environment and gives you a "to-do list" of improvements.
Recommendation Categories
|
Category |
What It Checks |
|---|---|
|
Cost |
Underutilized VMs, reserved instance opportunities, idle resources |
|
Security |
Security configuration weaknesses (links to Defender for Cloud) |
|
Reliability |
Redundancy issues, single points of failure, backup gaps |
|
Operational Excellence |
Best practices for management and deployment |
|
Performance |
Slow queries, underperforming resources, CDN recommendations |
Example Advisor Recommendations
Cost Recommendations:
✓ VM "WebServer-01" is only 3% CPU avg — consider resizing from D4s to B2ms → Save $120/month
✓ You have 3 unused public IP addresses → Delete to save $10.95/month
Reliability Recommendations:
✓ Production VM has no backup configured → Enable Azure Backup
✓ SQL Database has no geo-replication → Configure secondary replica
Security Recommendations:
✓ MFA not enabled for 3 admin accounts → Enable immediately
5. Azure Service Health
What Is It?
Azure Service Health provides personalized alerts and guidance when Azure service issues, planned maintenance, or health advisories affect the resources you use.
Three Components
|
Component |
What It Shows |
|---|---|
|
Azure Status |
Global Azure service status — major outages affecting everyone |
|
Service Health |
Personalized view — issues affecting YOUR subscriptions and regions |
|
Resource Health |
Specific health of YOUR individual resources |
Types of Health Events
|
Event Type |
Description |
|---|---|
|
Service Issues |
Current outages or degradation affecting Azure services |
|
Planned Maintenance |
Upcoming maintenance that may impact your resources |
|
Health Advisories |
Service changes requiring your attention |
|
Security Advisories |
Security-related issues affecting Azure services |
Service Health Alerts
You can configure alerts to be notified when Azure has an issue affecting your resources:
Alert: "Notify me if Azure SQL Database in East US has any outage"
↓
Azure has a SQL issue in East US
↓
Email sent to: dba-team@company.com immediately
6. Azure Arc
What Is It?
Azure Arc extends Azure management capabilities to resources outside of Azure — including on-premises servers, other cloud providers (AWS, GCP), and edge locations.
Azure Arc Projects Your Azure Control Plane Outward:
┌────────────────────────────────────────────────────────┐
│ Azure Portal │
│ (Single pane of glass for everything) │
└──────┬─────────────────────┬─────────────────┬─────────┘
│ │ │
Azure VMs On-Prem Servers AWS VMs
(Azure native) (Arc-enabled) (Arc-enabled)
What Azure Arc Enables
|
Capability |
Description |
|---|---|
|
Arc-enabled servers |
Manage Windows/Linux servers anywhere using Azure tools |
|
Arc-enabled Kubernetes |
Manage K8s clusters outside Azure |
|
Arc-enabled SQL Server |
Govern on-premises SQL Server from Azure |
|
Arc-enabled data services |
Run Azure SQL and PostgreSQL anywhere |
Benefits of Azure Arc
-
Single management pane for all infrastructure
-
Apply Azure Policy to non-Azure resources
-
Use Azure Monitor on on-premises servers
-
Tag and organize resources from anywhere in Azure
-
Consistent governance across hybrid and multi-cloud
Monitoring Tools Summary
|
Tool |
Purpose |
|---|---|
|
Azure Monitor |
Central platform for metrics, logs, and alerts |
|
Log Analytics |
Query and analyze log data with KQL |
|
Application Insights |
APM for web application performance tracking |
|
Azure Advisor |
Personalized recommendations for optimization |
|
Service Health |
Azure outage and maintenance notifications |
|
Azure Arc |
Extend Azure management to non-Azure resources |
Quick Recap
Azure Monitor → Collect metrics, logs, create alerts
Log Analytics → Query logs with KQL for deep analysis
App Insights → Monitor web app performance and errors
Azure Advisor → Recommendations for cost, security, reliability
Service Health → Know when Azure has issues affecting you
Azure Arc → Manage on-premises and multi-cloud from Azure
Official References
Next Chapter → Chapter 16: Azure Cost Management