Forum Discussion
Azure CLI to create the budget Alert
The 400 response says Azure rejected the budget representation. Reordering the same flags will not change that payload. A documented alternative is deploying a budget with an explicit modern API version through Azure CLI.
Save this as budget.bicep:
param alertEmail string
resource budget 'Microsoft.Consumption/budgets@2024-08-01' = {
name: 'MonthlyAlert'
properties: {
amount: 10
category: 'Cost'
timeGrain: 'Monthly'
timePeriod: {
startDate: '2026-11-01T00:00:00Z'
endDate: '2027-11-01T00:00:00Z'
}
notifications: {
actual80: {
enabled: true
operator: 'GreaterThanOrEqualTo'
threshold: 80
thresholdType: 'Actual'
contactEmails: [alertEmail]
}
}
}
}
Then run:
az deployment group create --resource-group LearnRG --template-file budget.bicep --parameters alertEmail=YOUR_EMAIL
Replace YOUR_EMAIL with the recipient and select the intended subscription before deployment. The notification threshold is 80 percent of the budget, not a monetary amount. Verify MonthlyAlert under LearnRG's Cost Management budgets afterwards. Deployment also requires budget-write and resource-deployment permissions.