The problem it solves
Finance gives Dev a limit of A$2,000 a month and wants a warning at 80% and again at 100%. Separately, Ravi suspects some VMs have been idle for weeks. And the exam will show Sarah a line of az or New-Az and ask what it does.
Budgets: an alarm, not a switch
How a budget works
- Pick a scopeManagement group, subscription or resource group: RG-Dev for Ravi's team.
- Set the amount and periodA$2,000 per month, reset on the 1st; optionally an end date.
- Set alert thresholds80% and 100% of actual spend, or of forecast spend (Azure projects the month-end from the trend).
- Choose who is toldEmail addresses, or an action group (which can also run automation).
- Understand what happens at 100%An email. Nothing stops. To shut VMs down you attach an action group whose action runs an Automation runbook or Logic App that deallocates them.
Quick check
Finance wants an email when RG-Dev reaches 80% and 100% of A$2,000 a month. Which statement is true?
Other cost tools
| Tool | Where | Use |
|---|---|---|
| Cost analysis | Cost Management › Cost analysis | Actual and forecast spend by service, resource group, tag, location |
| Cost alerts | Cost Management › Cost alerts | Budget alerts, credit alerts (prepaid credit running out), department quota alerts |
| Reservations and savings plans | Reservations | Commit to 1 or 3 years of a VM size or a spend level for a large discount |
| Azure Hybrid Benefit | VM › Configuration | Reuse Windows Server or SQL Server licences you already own with Software Assurance |
| Pricing calculator | azure.microsoft.com | Estimate before building |
Azure Advisor
Advisor shows recommendations in five categories. Each one names the resource, the problem and the fix, and can be postponed or dismissed.
| Category | Typical recommendation |
|---|---|
| Cost | Shut down or resize VMs under 5% CPU; delete unattached disks; buy a reservation |
| Security | Enable MFA; patch; restrict ports (from Defender for Cloud) |
| Reliability | Enable backup; use an availability set or zone; add a second VM |
| Operational excellence | Create a service health alert; use tags |
| Performance | Upgrade to Premium disks; use a closer region |
Advisor is free and runs on its own; you can set an alert when a new recommendation appears and a weekly digest email.
Quick check
Which Advisor category flags virtual machines that have run under 5% CPU for weeks?
Reading the command line
The exam does not ask you to write scripts. It shows a command and asks what it does, or lists four commands and asks which achieves a goal. Learn the pattern, not the whole language.
| Task | Azure PowerShell | Azure CLI |
|---|---|---|
| Sign in | Connect-AzAccount | az login |
| Choose the subscription | Set-AzContext -Subscription Prod | az account set -s Prod |
| Create a resource group | New-AzResourceGroup -Name RG1 -Location australiaeast | az group create -n RG1 -l australiaeast |
| Create a VM | New-AzVM -ResourceGroupName RG1 -Name vm1 -Image Win2022Datacenter | az vm create -g RG1 -n vm1 --image Win2022Datacenter |
| Stop a VM (deallocate) | Stop-AzVM -ResourceGroupName RG1 -Name vm1 | az vm deallocate -g RG1 -n vm1 |
| Assign a role | New-AzRoleAssignment -SignInName [email protected] -RoleDefinitionName Reader -ResourceGroupName RG1 | az role assignment create --assignee [email protected] --role Reader -g RG1 |
| Deploy a template | New-AzResourceGroupDeployment -ResourceGroupName RG1 -TemplateFile main.bicep | az deployment group create -g RG1 -f main.bicep |
- PowerShell:
Verb-AzNoun. Verbs: New, Get, Set, Remove, Start, Stop. Parameters start with a dash and a capital:-ResourceGroupName. - CLI:
az noun verb. Short options:-gresource group,-nname,-llocation,-ssubscription. - Both run in Cloud Shell (the
>_icon in the portal) with nothing installed on your PC; it asks for a small storage account the first time.
Quick check
Which command creates a resource group named RG1 in Australia East?
Memorise (definitions)
- Budget = alert only; action group + automation to act
- Advisor's five categories and what lands in each
- Reservation, savings plan, Hybrid Benefit
- Verb-AzNoun vs az noun verb; -g -n -l
Apply (scenarios you must solve)
- Build a budget with thresholds at the right scope
- Pick the Advisor tab for a symptom
- Match a command to its outcome
- Choose the cheapest option for a steady 3-year workload (reservation + Hybrid Benefit)
You, the admin: the Dev budget
- Cost Management › Budgets › + Add. Scope: change to resource group RG-Dev.
- Name Dev-Monthly, reset period Monthly, amount 2000.
- Alert conditions: Actual 80% → [email protected]; Actual 100% → finance plus the action group AG-Ops.
- Optional: AG-Ops contains an Automation runbook that deallocates every VM tagged AutoStop = true.
- Weekly: open Advisor › Cost and act on idle VMs and orphaned disks.
Script: az consumption budget create --budget-name Dev-Monthly --amount 2000 --time-grain Monthly --resource-group RG-Dev ...