Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az consumption budget command faulty #23825

Open
catluker-wandisco opened this issue Sep 8, 2022 · 13 comments
Open

az consumption budget command faulty #23825

catluker-wandisco opened this issue Sep 8, 2022 · 13 comments
Labels
consumption customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.

Comments

@catluker-wandisco
Copy link

Hi

I'm seeing this problem every time I try to run this command to get the details for my subscription -

az consumption budget list
Command group 'consumption' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
(422) This operation is not supported in the version specified in the request. Please use version 2019-10-01-preview or later. (Request ID: 8968fd1b-5987-4fc8-842a-69962d47f19f)

The command appears to be calling an out of date API - '2018-01-31' . My CLI version is 2.40.0.

Is this command actually working? If not it would be good if it wasn't available until it is.

Thanks

Cat


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 8, 2022
@yonzhan yonzhan added consumption CXP Attention This issue is handled by CXP team. labels Sep 9, 2022
@ghost
Copy link

ghost commented Sep 9, 2022

Thank you for your feedback. This has been routed to the support team for assistance.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 9, 2022

route to CXP team

@RakeshMohanMSFT RakeshMohanMSFT self-assigned this Sep 9, 2022
@RakeshMohanMSFT
Copy link
Contributor

@catluker-wandisco Thank you for reaching out, we are looking into it.

@RakeshMohanMSFT
Copy link
Contributor

@catluker-wandisco We are unable to reproduce this issue? can you share your environment details using az --version?

image

@RakeshMohanMSFT RakeshMohanMSFT added the needs-author-feedback More information is needed from author to address the issue. label Sep 9, 2022
@catluker-wandisco
Copy link
Author

catluker-wandisco commented Sep 11, 2022 via email

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Sep 11, 2022
@RakeshMohanMSFT
Copy link
Contributor

@catluker-wandisco I am really unable to reproduce this issue, let me engage the product team to look into it.

@RakeshMohanMSFT RakeshMohanMSFT added Service Attention This issue is responsible by Azure service team. and removed CXP Attention This issue is handled by CXP team. labels Sep 12, 2022
@RakeshMohanMSFT RakeshMohanMSFT removed their assignment Sep 12, 2022
@zomilanovic
Copy link

zomilanovic commented Sep 15, 2022

I have the same issue on an Intel iMac running macOS Version 12.6 (Monterey).

az --version has the following output:

azure-cli                         2.40.0

core                              2.40.0
telemetry                          1.0.8

Extensions:
ssh                                1.1.2
dataprotection                     0.6.0
serial-console                     0.1.2

Dependencies:
msal                            1.18.0b1
azure-mgmt-resource             21.1.0b1

Python location '/usr/local/Cellar/azure-cli/2.40.0/libexec/bin/python'
Extensions directory '/Users/milo/.azure/cliextensions'

Python (Darwin) 3.10.6 (main, Aug 30 2022, 05:12:36) [Clang 13.1.6 (clang-1316.0.21.2.5)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Running the az consumption budget list command fails with the following output:

Command group 'consumption' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
(422) This operation is not supported in the version specified in the request. Please use version 2018-12-01-preview or later. (Request ID: c04aeda6-ce67-49cf-a850-ca2687e99f6d)

When I run the command with the --debug flag, I found the following line(s) of the output hints the "culprit":

.
.
.
msrest.http_logger: Request URL: 'https://management.azure.com/subscriptions/<redacted-subscription-id>/providers/Microsoft.Consumption/budgets/vps-abo?api-version=2018-01-31'
.
.
.
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<redacted-subscription-id>/providers/Microsoft.Consumption/budgets?api-version=2018-01-31 HTTP/1.1" 422 208
.
.
.

I think it would be handy if there were a way to specify which api-version is used by az with an according flag or something similar to avoid problems like this in the future.

Thanks in advance, and I hope the information provided helps resolve this issue!

@catluker-wandisco
Copy link
Author

Yes, that's exactly what I see - --debug shows me the GET request that's sent is going to

urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions//providers/Microsoft.Consumption/budgets/?api-version=2018-01-31 HTTP/1.1" 422 208

and the resulting error is

msrest.exceptions: (422) This operation is not supported in the version specified in the request. Please use version 2019-10-01-preview or later. (Request ID: e2e72bb6-312f-47c2-823f-60f0b310db34)

cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 363, in handler
show_exception_handler(ex)
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/arm.py", line 429, in show_exception_handler
raise ex
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 361, in handler
return op(**command_args)
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/consumption/custom.py", line 103, in cli_consumption_show_budget
return client.get(budget_name)
File "/usr/local/Cellar/azure-cli/2.40.0/libexec/lib/python3.10/site-packages/azure/mgmt/consumption/operations/budgets_operations.py", line 212, in get
raise models.ErrorResponseException(self._deserialize, response)
azure.mgmt.consumption.models.error_response.ErrorResponseException: (422) This operation is not supported in the version specified in the request. Please use version 2019-10-01-preview or later. (Request ID: e2e72bb6-312f-47c2-823f-60f0b310db34)

@zomilanovic
Copy link

@RakeshMohanMSFT any news or updates from the product team so far? Did the additional information we gave you help?

@danieldjewell
Copy link

danieldjewell commented Jun 9, 2023

I can also confirm that I'm seeing this issue with the latest version of azure-cli installed ....

It may have something to do with the fact that the version of the azure.mgmt.consumption Python module that is installed is only v2.0.0 and yet it would appear that the current version is v11 (see https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py)

It would appear that v2.0 azure.mgmt.consumption module is older than May, 2019.....

Edit: See the package requirements here:

azure-mgmt-consumption==2.0.0

The fact that there are just so many individual modules in the azure-mgmt-* namespace -while indeed flexible- does appear to add a level of complexity to ensure that the correct/latest versions are used.

Edit2: For what it's worth, there appear to be breaking changes in the design of azure-mgmt-consumption as doing a pip install -U azure-mgmt-consumption (which will update the module to v10.0.0) will break the current version of azure-cli.

@joelfernandes23
Copy link

joelfernandes23 commented Jul 21, 2023

Issue seems to be still active as of July 2023.
az consumption usage list
Command group 'consumption' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus (400) Subscription scope usage is not supported for current api version. Please use api version after 2019-10-01 (Request ID: b03618b4-6fc9-4cc0-b359-6149084125c4)

@CarlosJoseChaconChavarria

Issue seems to be still active as of July 2023. az consumption usage list Command group 'consumption' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus (400) Subscription scope usage is not supported for current api version. Please use api version after 2019-10-01 (Request ID: b03618b4-6fc9-4cc0-b359-6149084125c4)

yes indeed

@jarrettprosser
Copy link

I'm getting the same error on Mac with az-cli 2.52.0.

kairu-ms pushed a commit that referenced this issue Jan 12, 2024
…27833)

* fix(consumption): update api version to 2023-05-01

* fix: update tests api version to 2023-05-01
MaxHorstmann pushed a commit to MaxHorstmann/azure-cli that referenced this issue Jan 19, 2024
…I version (Azure#27833)

* fix(consumption): update api version to 2023-05-01

* fix: update tests api version to 2023-05-01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumption customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants