Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

`az consumption budget create` failing #29950

Open letmaik opened 1 month ago

letmaik commented 1 month ago

Describe the bug

--resource-group-filter doesn't seem to work.

Related command

az consumption budget create --amount 1000 --budget-name ... --category cost --start-date 2024-09-22 --end-date 2025-09-22 --time-grain annually --resource-group-filter abc-rg def-rg --subscription ... --debug

Errors

{"error":{"code":"400","message":"Invalid budget configuration, please use filter interface with 2019-05-01-preview version (Request ID: f93d3dce-0a4b-4f28-b971-d347a23903eb)"}}

Issue script & Debug output

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/.../providers/Microsoft.Consumption/budgets/...?api-version=2023-05-01'
cli.azure.cli.core.sdk.policies: Request method: 'PUT'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'Content-Length': '248'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': '3b7b38c9-7910-11ef-b199-f3f9b7eefc77'
cli.azure.cli.core.sdk.policies:     'CommandName': 'consumption budget create'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--amount --budget-name --category --start-date --end-date --time-grain --resource-group-filter --subscription --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.64.0 (DEB) azsdk-python-core/1.28.0 Python/3.11.8 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"properties": {"amount": 1000.0, "category": "cost", "filters": {"resourceGroups": ["def-rg", "abc-rg"]}, "timeGrain": "annually", "timePeriod": {"endDate": "2025-09-21T23:00:00.000Z", "startDate": "2024-09-21T23:00:00.000Z"}}}

Expected behavior

No error.

Environment Summary

$ az version { "azure-cli": "2.64.0", "azure-cli-core": "2.64.0", "azure-cli-telemetry": "1.1.0", "extensions": { "ml": "2.30.1", "ssh": "2.0.5", "storage-preview": "1.0.0b4" } }

Additional context

No response

yonzhan commented 1 month ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ms-premp.