Forum Discussion
Azure CLI to create the budget Alert
Hello All,
I am new to Azure CLI and trying to create the Budget alert. While using below commands i am keep getting the error. Please assist me to fix the issue.
Syntax-
az consumption budget create --budget-name "MonthlyAlert" --amount 10.0 --time-grain "Monthly" --start-date "2026-11-01" --end-date "2027-11-01" --resource-group "LearnRG" --category "cost"
I also tried
az consumption budget create --budget-name MonthlyAlert --amount 10.0 --time-grain Monthly -s 2026-11-01 -e 2027-11-01 --resource-group LearnRG --category cost
Command group 'consumption' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
(400) Invalid budget configuration, please use filter interface with 2019-05-01-preview version (Request ID: 8726e67e-4c5b-4830-8318-0da1c5a688fb)
Code: 400
Message: Invalid budget configuration, please use filter interface with 2019-05-01-preview version (Request ID: 8726e67e-4c5b-4830-8318-0da1c5a688fb)
2 Replies
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.
That error occurs because the Azure CLI az consumption budget create command requires the filter interface introduced in API version 2019‑05‑01‑preview, and the syntax must include a scope (subscription, resource group, or management group) plus a filter block. The simplified form you used omits those parameters, so the service rejects it.