D5 · Monitoring

Diagnostics

Diagnostics in Azure go beyond metrics: Diagnostic Settings, Activity Log, Resource Health and Service Health form the visibility ecosystem for what's happening with your resources and the Azure platform. The AZ-104 exam evaluates all of these components.

Diagnostic Settings

Diagnostic Settings are the per-resource configuration that determines which telemetry data is exported and to which destinations. Without Diagnostic Settings, resource logs and granular metrics are NOT captured outside the resource.

What can be captured

Metrics

The resource's metrics (the same ones available in Metrics Explorer). Useful for exporting to Storage for long retention or to Event Hub for streaming.

Resource Logs (categories)

Each resource exposes specific log categories. E.g. SQL has SQLInsights, Errors, QueryStoreRuntimeStatistics. You can select individual categories or "All Logs".

Available destinations

Near real-time analysis with KQL. Log-based alerts. The most common destination for operations.

Storage Account

Long-term archiving. JSON format in containers named by log type. For compliance/auditing with years of retention.

Event Hub

Real-time streaming to external systems. Ideal for SIEM (Splunk, Sentinel, QRadar), data lakes or custom processing.

Partner Solution

Direct integration with certified partner solutions (Datadog, Elastic, etc.).

Scope of Diagnostic Settings

Per individual resource

Each resource has its own "Diagnostic Settings" section. Configure them one by one or use Azure Policy to apply automatically to all resources of a type in a subscription/group.

Subscription (Activity Log)

The Activity Log has its own Diagnostic Settings at the subscription level. Configured under Monitor → Activity Log → Diagnostic Settings.

Activity Log in detail

The Activity Log records all write operations (PUT, POST, DELETE) performed on Azure resources — who did what action on which resource, when, and the result. It's the audit trail of Azure's control plane.

Important fields in each entry

CallerEmail of the user or name of the service principal that performed the operation
operationNameOperation performed: Microsoft.Compute/virtualMachines/write, etc.
eventTimestampWhen the operation occurred
resourceGroupAffected resource group
resourceTypeResource type (Microsoft.Compute/virtualMachines)
resultTypeSuccess or Failed
levelInformational, Warning, Error, Critical
propertiesAdditional details of the operation (request body, response, etc.)

Activity Log categories

• Administrative: CRUD operations on resources

• Security: alerts from

• Service Health: Azure incidents and maintenance

• Alert: Azure Monitor alerts fired

• Autoscale: automatic scaling actions

• Recommendation: Azure Advisor recommendations

• Policy: evaluations

Retention and export

  • • Free retention in Azure: 90 days
  • • For more than 90 days: Diagnostic Settings → Log Analytics or Storage
  • • KQL table: AzureActivity
  • • Activity Log alert: near real-time (seconds)

Azure Resource Health

Azure Resource Health reports on the health of the specific resource — distinguishing whether a problem is caused by the Azure platform or by the user's configuration. It lets you tell apart an Azure outage from a problem the customer needs to fix.

Resource Health states

Available

The resource is working correctly. No issues detected.

Unavailable

The resource has known issues. It can be an Azure incident (platform) or a user issue (configuration).

Degraded

The resource works but with reduced capacity or warnings.

Unknown

Azure has not received signals from the resource for more than 10 minutes. Transient state or the resource is offline.

How to use Resource Health

  • • Access: Portal → specific resource → Resource Health in the side bar
  • • Or from: Azure Monitor → Service Health → Resource Health
  • • Shows health history for the last 30 days with root cause
  • • Differentiates between: Platform-initiated (Azure fails) and User-initiated (the customer restarts, deallocates)
  • • Useful for support: evidence that the problem was on the platform (for SLA credit requests)
  • • Resource Health alerts can be configured in Azure Monitor

Azure Service Health

Azure Service Health reports on the health of Azure services globally and their impact on your subscription. It includes active incidents, planned maintenance and health advisories.

Service Issues

Active outages in Azure services that may affect your subscription. Includes affected region(s), impacted services, root cause (post-incident) and resolution status.

Planned Maintenance

Scheduled maintenance that may require customer action or cause brief downtime. Microsoft notifies in advance (generally 2+ weeks).

Health Advisories

Notices of deprecated features, behavior changes or recommended actions. They don't imply an outage but require attention before deadlines.

Key difference: Service Health vs Resource Health

Service Health

Reports on Azure's infrastructure. If East US has an Azure Compute outage, Service Health shows it. It's not specific to your resources.

Resource Health

Reports on YOUR specific resource. Your specific VM (vm-prod-01) is Available or Unavailable — and whether it's due to Azure or your own configuration.

Azure Advisor

Azure Advisor is Azure's personalized recommendations service. It analyzes your resource configuration and recommends improvements across five main categories.

Reliability (High Availability)

  • →Add a second VM to an Availability Set
  • →Enable soft-delete on a Storage Account
  • →Configure backup on a VM without backup
  • →Add availability zones to critical resources

Security

  • →Enable MFA for privileged accounts
  • →Close RDP/SSH ports exposed to the internet
  • →Install Microsoft Defender for Cloud on VMs
  • →Encrypt unencrypted disks

Performance

  • →Switch to Premium SSD for VMs with high IOPS
  • →Adjust an oversized VM size
  • →Enable Accelerated Networking on compatible VMs
  • →Use Redis cache to reduce DB load

Cost

  • →Underutilized VMs (CPU <5% for 14 days) — resize or deallocate
  • →Reserved Instances: purchase recommended based on historical usage
  • →Delete orphaned disks with no attached VM
  • →Long-lived unused snapshots

Operational Excellence

  • →Update deprecated SDKs/APIs
  • →Follow naming conventions
  • →Configure recommended alerts
  • →Use infrastructure as code (ARM/Bicep/Terraform)

and cost diagnostics

Cost Analysis

Visualizes spend by service, resource group, tag, location. Allows filtering and grouping in multiple ways. Identifies the most costly resources and spending trends.

  • •Available in: Subscriptions, Resource Groups, Management Groups
  • •Daily, monthly, cumulative view
  • •Export to CSV or connect to Power BI
  • •Compare vs. previous period

Budgets

Define spending thresholds and get alerted when they are reached. Automatic actions (action groups) can be configured when exceeding 50%, 80%, 100% of the budget.

  • •Scope: subscription, resource group, or filters by service/tag
  • •Alerts at: 50%, 80%, 100% (actual and forecasted)
  • •Doesn't block spending — only alerts
  • •Renewal: monthly, quarterly, annual

Did you get this topic?

Test what you just learned

An administrator accidentally deletes a critical resource group. In which Azure service can they find exactly who performed the deletion, at what time and from which IP?

Ready to test "Diagnostics"?

Put what you learned to the test with original AZ-104 exam questions.

Start AZ-104 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.