Read Advisor and Service Health, then make Azure tell you about its own outages

short · 30 min · Skills measured 3.4

Task

Read the personalised recommendations Azure Advisor has for your subscription and find its score, then read Azure Service Health's view of the services and regions you use and compare it with the public Azure status page. Then set up the alert lesson 16 recommends: an action group that emails you, and a Service Health alert (an activity log alert) that uses it whenever Azure posts an outage, planned maintenance or an advisory affecting your subscription. Finally, read the activity log to see who created what, and say which of the three services answers which question.

Steps

  1. Open Cloud Shell (Bash), choose your subscription and create the lab's resource group, which will hold the action group and the alert rule:
az account set --subscription 00000000-0000-0000-0000-000000000000
az group create --name az900-lab16-rg --location eastus
  1. Read Azure Advisor. In the portal, open Advisor and look at Advisor score and the five categories: Reliability, Security, Performance, Cost and Operational excellence. A subscription used only for this course may have few or no recommendations. Then count them by category from the CLI:
az advisor recommendation list --category Cost --query 'length(@)' -o tsv
az advisor recommendation list --category OperationalExcellence --query '[].shortDescription.problem' -o tsv

Advisor reads and recommends; it changes nothing on its own. You can dismiss or postpone a recommendation, or apply it yourself, some with a Quick Fix. 3. Read Azure Service Health. In the portal, open Service Health and look at Service issues, Planned maintenance, Health advisories, Security advisories and Health history. Everything there is filtered to the services and regions your subscription uses. Then, in a new tab, search for Azure status and open Microsoft's public status page, which needs no sign-in and shows every region. Finally, open Resource health in Service Health: it is where one resource's own availability would show. 4. Create an action group: the reusable list of who is told when an alert fires. Its short name can be at most 12 characters.

az monitor action-group create --name az900-lab16-ag --resource-group az900-lab16-rg --short-name az900lab16 --action email learner you@example.com

Put your own email address in place of you@example.com. Azure sends you an email saying you were added to the action group. 5. Create the Service Health alert, which watches the activity log of your whole subscription for Service Health events and uses the action group to tell you:

az monitor activity-log alert create --name az900-lab16-health --resource-group az900-lab16-rg --scope "/subscriptions/$(az account show --query id -o tsv)" --condition category=ServiceHealth --action-group az900-lab16-ag --description "Azure service issues, maintenance and advisories for this subscription"

The condition belongs to the alert rule; who is told belongs to the action group. In the portal, open Monitor, choose Alerts, then Alert rules: az900-lab16-health is listed and enabled. 6. Read the activity log, Azure Monitor's record of management operations, for what you just did:

az monitor activity-log list --resource-group az900-lab16-rg --offset 1h --query '[].operationName.localizedValue' -o tsv

It lists the write operations for the resource group, the action group and the alert rule, each recorded with the identity that made it. An auditor asking who created or deleted something asks this log, not a metrics chart. 7. Decide which service answers each question, then check your answers in the Notes. (a) Is there an outage in the region our subscription uses, right now? (b) Which of our virtual machines have run at very low CPU for weeks? (c) Is Azure having a widespread outage, for a consultant with no subscription access? (d) Who deleted a storage account last week? (e) How slow are our web application's page responses, and which dependency fails? (f) Text the on-call engineer when average CPU on a production VM passes 90 percent.

Verify

az monitor activity-log alert show --name az900-lab16-health --resource-group az900-lab16-rg --query enabled -o tsv

Expected output: true.

az monitor action-group show --name az900-lab16-ag --resource-group az900-lab16-rg --query groupShortName -o tsv

Expected output: az900lab16.

Cost and clean-up

Reading Advisor, Service Health and the activity log is free, and activity log alerts are free. Action group notifications can be charged beyond an allowance, and charges are possible for anything you add beyond these steps, so clean up today.

Created by this lab: the resource group az900-lab16-rg; the action group az900-lab16-ag in it; the Service Health alert rule az900-lab16-health in it.

  1. Delete the resource group, which deletes the action group az900-lab16-ag and the alert rule az900-lab16-health with it. Lesson 1's budget is not touched; it is a separate alert, on cost.
az group delete --name az900-lab16-rg --yes

Check it is gone

az group exists --name az900-lab16-rg

Expected output: false.

Notes

Answers to step 7: (a) Azure Service Health, the personalised view. (b) Azure Advisor, a cost recommendation. (c) The public Azure status page. (d) The activity log in Azure Monitor. (e) Application Insights, part of Azure Monitor. (f) An Azure Monitor metric alert rule, whose action group sends the text.

Log Analytics workspaces and Application Insights resources are described in lesson 16 but not created here: each would start collecting billable data, and the free reads above teach the same distinctions.

If a create fails with MissingSubscriptionRegistration, your subscription has not used Azure Monitor yet. Register it once with az provider register --namespace Microsoft.Insights, wait until az provider show --namespace Microsoft.Insights --query registrationState -o tsv prints Registered, and run the create again. Registering a resource provider is free.

This is an independent study companion for the Microsoft Azure Fundamentals (AZ-900) exam and is not produced by or endorsed by Microsoft. Microsoft, Azure and Microsoft Entra are trademarks of the Microsoft group of companies.

This is an independent study companion for Microsoft Azure Fundamentals AZ-900 and is not produced by or endorsed by CompTIA.