-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
the error "(401) Unauthorized" occurs when try to iterate from the results of comsumption.usage_details.list() #4362
Comments
Hi @imeya Please update your SP permissions level to this role, and let us know if your problem is solved. |
@lmazuel , thank you very much. do you mind that let me how do date filter in the code below:
Seams that the filter does not respect the date_filter, is there something wrong with my date_filter? |
Hi @lmazuel ! I have almost the same issue.
It prints a lot of lines, but at the end raises error:
|
@imeya from the unittests written by the service team in charge of this service: output = list(self.consumption_client.usage_details.list_by_billing_period(
billing_period_name=MgmtConsumptionTest.billingPeriodName,
expand='properties/meterDetails,properties/additionalProperties',
filter='usageEnd eq 2017-10-26T23:59:59Z'
)) Adding @kjeur from the team to help for details and authentication question. |
Getting same 401 error, when calling get/create method on budgets. This is an intermittent error. |
still happens for me, appears to only happen when retrieving data from over 12 months ago, and using a skipToken param |
Hello people, #Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions results = consumption_client.usage_details.list(scope = '/subscriptions/' + subscription_id +'/', expand='properties/meterDetails, properties/additionalInfo', filter="""properties/usageStart ge '2020-05-14' and properties/usageEnd le '2020-05-14'""") for result in results: |
Please try this example, we are not able to repro this issue. |
Closing per above. |
I'm trying to use ConsumptionManagementClient to get the usage details with a date_filter, but receive the following error: azure.mgmt.consumption.models.error_response.ErrorResponseException: (401) Unauthorized.
My code as below(the same credentials works well for vm usage):
The screenshot of error message:
Please let me know if I misunderstand or miss something. For authentication, I followed this doc.
The text was updated successfully, but these errors were encountered: