Set a budget alert first, then see the public cloud's self-service for yourself

short · 25 min · Skills measured 1.1

Task

Before anything else, set a monthly cost budget on your subscription in Microsoft Cost Management, with email alerts, and read it back from the command line. Then see three features of cloud computing from lesson 1 for yourself: you are working in the public cloud, you can create something in seconds without buying anything (self-service on demand), and what you use is metered (measured use). Finish by deciding who owns each duty under the shared responsibility model for a virtual machine, Azure App Service and Microsoft 365, and which cloud model fits six short scenarios. The budget stays in place when you finish, because every later lab in this course relies on it.

Steps

  1. Set the budget before you do anything else. In the Azure portal, search for Cost Management and open it, then choose Budgets. Check that the scope shown at the top of the page is your subscription, not a resource group; if it is not, choose Scope and select the subscription. Choose Add. On Create budget, name it az900-monthly-budget, keep Reset period as Monthly and the start date as this month, and set Amount to a small figure in your billing currency: the least you would want to hear about. Choose Next. Under Alert conditions, add two alerts: type Actual at 50 percent of the budget, and type Forecasted at 100 percent. Under Alert recipients (email), enter you@example.com, putting your own email address in its place. Choose Create. The budget now watches the whole subscription, so it sees spending in every resource group you make later.
  2. Open Azure Cloud Shell from the Cloud Shell button in the portal's top bar and choose Bash. The first time it starts, choose No storage account required, pick your subscription and choose Apply. Then check which cloud and which subscription the CLI is using:
az cloud show --query name -o tsv
az account show --query name -o tsv

The first command prints AzureCloud: the global public cloud, which Microsoft builds, owns and maintains, and sells to any organisation or person. The second prints your subscription's name. If you have more than one subscription and it is the wrong one, switch with az account set --subscription "My subscription name" before going on. 3. See self-service on demand. Create a resource group, a free container for resources, with a tag that records which cloud model it lives in:

az group create --name az900-lab01-rg --location eastus --tags model=public

This lab uses the region eastus. You may pick one nearer to you, but use it in every command. The command comes back within seconds with "provisioningState": "Succeeded". Nobody raised a purchase order, nothing was shipped and there is nothing to depreciate. That is the difference between renting cloud services and buying servers, or renting rack space for servers you own, which is colocation. 4. See measured use. In the portal, go back to Cost Management and choose Cost analysis, with your subscription as the scope. The chart shows what this subscription has been metered for so far this month. On a new subscription it is probably empty, and the resource group adds nothing, because a resource group costs nothing. Every resource that does cost money appears here as it is used, usually some hours later. That delay is why the budget alert from step 1 matters: it watches the meter even when you are not looking. 5. Decide who owns each duty under the shared responsibility model, for three workloads: a Windows Server virtual machine in Azure (IaaS), a web app on Azure App Service (PaaS), and email in Microsoft 365 (SaaS). For each workload, write Microsoft or Customer against each duty: (a) replacing a failed disk in a host server; (b) installing security updates on the operating system; (c) deciding which staff can sign in; (d) the data that is stored; (e) guarding the datacenter building; (f) writing and maintaining the application code. Check your answers in the Notes. 6. Match each scenario to the cloud model it describes: public, private, hybrid, multi-cloud, or not cloud computing at all. (1) A start-up with no datacenter and little capital wants to launch next month. (2) A defence contractor's system must run on hardware no other organisation shares. (3) A hospital keeps patient records in its own datacenter and runs its appointment website in Azure, with the two connected. (4) A retailer whose own servers cannot handle the holiday peak sends the extra traffic to Azure and pulls back in January. (5) A company with no datacenter runs some workloads in Azure and others with a second public provider. (6) A business leases rack space in someone else's building for servers it bought itself. Check your answers in the Notes.

Verify

Read the budget back from Cloud Shell:

az consumption budget show --budget-name az900-monthly-budget --query name -o tsv

Expected output: az900-monthly-budget.

Count its alerts. Put your own subscription ID in place of 00000000-0000-0000-0000-000000000000; az account show --query id -o tsv prints it.

az rest --method get --url "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/az900-monthly-budget?api-version=2021-10-01" --query 'length(keys(properties.notifications))' -o tsv

Expected output: 2, one for the Actual alert and one for the Forecasted alert.

Check the resource group carries its tag:

az group show --name az900-lab01-rg --query tags.model -o tsv

Expected output: public.

In the portal, the Cost Management > Budgets page lists az900-monthly-budget with the reset period Monthly.

Cost and clean-up

Charges are possible in any subscription, but this lab creates nothing that is billed: a Cost Management budget and an empty resource group carry no charge. The budget is kept on purpose.

Created by this lab: the resource group az900-lab01-rg, empty and tagged model=public.

Kept on purpose: the budget az900-monthly-budget on your subscription, with its two email alerts, which every later lab in this course relies on.

  1. Keep the budget az900-monthly-budget: every later lab in this course relies on it, so it stays on your subscription on purpose.
  2. Delete the resource group az900-lab01-rg:
az group delete --name az900-lab01-rg --yes

Check it is gone

az group exists --name az900-lab01-rg

Expected output: false.

az consumption budget show --budget-name az900-monthly-budget --query name -o tsv

Expected output: az900-monthly-budget, still there on purpose.

Notes

Step 5 answers. (a) Replacing a failed host disk: Microsoft, for all three. (b) Operating system updates: Customer for the virtual machine; Microsoft for App Service and Microsoft 365. (c) Who can sign in: Customer, for all three. (d) The stored data: Customer, for all three. (e) Guarding the building: Microsoft, for all three. (f) Application code: Customer for the virtual machine and for App Service, where it is the customer's own code on Microsoft's runtime; Microsoft for Microsoft 365. The fixed ends never move: physical datacenter, network and hosts are always Microsoft's, and data, devices, and accounts and identities are always the customer's.

Step 6 answers. (1) Public. (2) Private: dedicated hardware, which a third party can host but which serves one organisation. (3) Hybrid: a private environment connected to a public cloud. (4) Hybrid, using cloud bursting. (5) Multi-cloud: two public providers and no private environment, so it cannot be hybrid. (6) Not cloud computing: colocation, because the business still owns and maintains its servers.

If az consumption budget show reports an error rather than the budget's name, use the az rest command in Verify, which reads the same budget through Azure Resource Manager, and change its query to properties.timeGrain: it prints Monthly.

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.