Skip to content
AZ-10 Draft

Create budgets and alert processing rules when the cmdlets are missing

When the cmdlet you need isn't available in Cloud Shell, call the REST API directly with Invoke-AzRestMethod.

Draft. The fix is known and correct, but we're still writing up the full step-by-step.

The problem

Some management cmdlets (for budgets and alert processing rules, depending on module versions) aren’t available or don’t expose the options you need in Cloud Shell.

The fix

Invoke-AzRestMethod calls the Azure Resource Manager REST API using your existing Cloud Shell sign-in.

$sub  = (Get-AzContext).Subscription.Id
$path = "/subscriptions/$sub/providers/Microsoft.Consumption/budgets/monthly-budget?api-version=2023-05-01"
$body = @{
  properties = @{
    category  = "Cost"
    amount    = 500
    timeGrain = "Monthly"
    timePeriod = @{ startDate = "2026-12-01T00:00:00Z" }
    notifications = @{
      actual80 = @{ enabled = $true; operator = "GreaterThan"; threshold = 80; contactEmails = @("[email protected]") }
    }
  }
} | ConvertTo-Json -Depth 6
Invoke-AzRestMethod -Method PUT -Path $path -Payload $body

Check the response StatusCode. A 200 or 201 means it worked, and the Content body explains any error. Check the current API version in Microsoft’s REST reference.

This guide is being expanded with full steps.

Seeing this in your environment?

We can check for this, and everything around it, as part of an audit.

Ask us about AZ-10

Find out what's really going on in your tenant.

Tell us what you run and what's worrying you. We'll recommend the right audit, and tell you honestly if you don't need one.