azure-sdk-for-python: The resource type 'Query' could not be found in the namespace 'Microsoft.CostManagement' for api version '2020-06-01'
- Package Name: azure-mgmt-costmanagement
- Package Version: 1.0.0b1
- Operating System: WSL Ubuntu 18.04
- Python Version: 3.6.9
Describe the bug
Getting the following error :
azure.core.exceptions.ResourceNotFoundError: (InvalidResourceType) The resource type 'Query' could not be found in the namespace 'Microsoft.CostManagement' for api version '2020-06-01'. The supported api-versions are '2018-05-31,2018-08-31,2018-08-01-preview,2018-10-01-preview,2018-12-01-preview,2019-01-01,2019-03-01-preview,2019-04-01-preview,2019-05-01-preview,2019-10-01,2019-11-01'.
To Reproduce Steps to reproduce the behavior:
- pip3 install azure-mgmt-costmanagement==1.0.0b1
- call query.usage method
client = CostManagementClient(credential, "https://management.azure.com")
client.query.usage(scope=sub_id,parameters=parameters)
Expected behavior Query should work and produce data
Additional context
API version seems hardcoded here :
https://github.com/Azure/azure-sdk-for-python/blob/739b24a25158a471159bae887ab8f6907f347727/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py#L65
I downloaded the sources, and changed the api_version = "2020-06-01"
value to "2019-11-01"
. It solves my issue locally.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 16 (6 by maintainers)
Since I found no way to set the api version from outside I did some hacky things:
new package for ‘20219-11’ : https://pypi.org/project/azure-mgmt-costmanagement/2.0.0/
similar issue : https://github.com/Azure/azure-sdk-for-python/issues/18957