Azure-docs: Resource group scope does not work as documented

Created on 11 Sep 2019  Â·  12Comments  Â·  Source: MicrosoftDocs/azure-docs

When using the Usage Details - List REST API, specifying a scope with a resource group returns a 404 - File or directory not found error.

The documentation says to specify the scope as /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName} but this returns the 404 error.

As a workaround, you can specify the resource group in the filter like $filter=properties/resourceGroup eq '{resourceGroupName}'; however, this does not work with the latest version of the API (2019-05-01).
If you specify the filter, the following error is returned:

{
    "error": {
        "code": "400",
        "message": "Billing Period is not supported in (2019-05-01) API Version for Subscription Scope With Web Direct Offer. (Request ID: adf9d616-cc8f-48c9-84eb-8fa59d528170)"
    }
}

Changing the API version to the previous stable release (2019-01-01) allows the filter to work.
This is an example of the full URI: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2019-05-01&$filter=properties/resourceGroup eq 'dev-rg'

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

ID: 77db9ac7-6b1c-496b-36a3-24119c897546
Version Independent ID: 31fbb3ed-1eb8-ff0c-05d8-1e92ccc1519f
Content: Azure consumption API overview
Content Source: articles/billing/billing-consumption-api-overview.md
Service: billing
GitHub Login: @bandersmsft
Microsoft Alias: banders

Pri3 assigned-to-author awaiting-product-team-response billinsvc escalated-product-team product-bug triaged

Most helpful comment

I'm getting the same error when making a call to the Usage Details List with the 2019-10-01 API:

https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2019-10-01

Results in the error:

{"code":"400","message":"Billing Period is not supported in (2019-10-01) API Version for Subscription Scope With Web Direct Offer. (Request ID: 69e0e402-d3fd-49a3-b7d8-728f272aa51d)"}

Making the same call using the 2019-01-01 API is successful, but is not in line with the documentation and is missing fields (resourceGroup etc).

Any resolution?

All 12 comments

@AndrewGailer Thanks for the comment. This feedback has been shared with @bandersmsft for further review.

I am also facing the same issue do we have any resolution on the above question ?

I'm getting the same error when making a call to the Usage Details List with the 2019-10-01 API:

https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2019-10-01

Results in the error:

{"code":"400","message":"Billing Period is not supported in (2019-10-01) API Version for Subscription Scope With Web Direct Offer. (Request ID: 69e0e402-d3fd-49a3-b7d8-728f272aa51d)"}

Making the same call using the 2019-01-01 API is successful, but is not in line with the documentation and is missing fields (resourceGroup etc).

Any resolution?

@bandersmsft Are there any news on this issue? It still returns "Billing Period is not supported in (2019-11-01) API Version for Subscription Scope With Web Direct Offer. (Request ID: 69fda2f6-f14b-4202-8b6e-6f906a1d9a8b)" for subscription-based scopes. Even worse, the previously usable api-version "2019-01-01" started to return an empty array only.
Edit: The api-version "2019-01-01" now again delivers content (seems that there was just a temporary unavailability).

Same issue here : Billing Period is not supported in (2019-10-01) API Version for Subscription Scope.
Latest working version at Subscription scope is 2019-01-01. Is there any ways to query this last version?

I got the same error with go-autorest for https://management.azure.com/subscriptions/XXXXXXXX/providers/Microsoft.Consumption/usageDetails?&api-version=2019-10-01:

consumption.UsageDetailsClient#List: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="400" Message="Billing Period is not supported in (2019-10-01) API Version for Subscription Scope With Web Direct Offer. Please provide the UsageStart and UsageEnd dates in the $filter key as parameters. (Request ID: adcd9582-23c2-4d11-a53c-698b4a4845b8)"

I didn't provide any billing periods in the request. And how can I provide UsageStart and UsageEnd dates for usagedetails?

@KrishnaG-MSFT This issue doesn't directly affect the article published to https://docs.microsoft.com/azure/cost-management-billing/manage/consumption-api-overview

This appears to be a bug with https://docs.microsoft.com/rest/api/consumption/usagedetails/list and that's maintained by the engineering team. Can please reassign as a product bug, not a doc issue? Thanks.

Hi @bandersmsft, is there a workaround or an ETA on the product bug fix? I am having a similar issue with the usageDetails endpoint, specifically i cannot filter on tags in the $filter parameter. Stack overflow question with the problem I'm having

Unable to add @prkumarms-zz in assignees so tagging @prkumarms-zz for visibility, review and to help provide insights.

Hello,

I'm having the same error message with Az consumption usage list, I cannot pull any usage info
https://github.com/Azure/azure-powershell/issues/10203

@PcChip Hey, i found a workaround. If you check out the comment i made in my stack overflow post it may help:

https://stackoverflow.com/questions/63125218/azure-usagedetails-rest-api-cannot-filter-on-tags

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianpowell2017 picture ianpowell2017  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments

Favna picture Favna  Â·  3Comments

varma31 picture varma31  Â·  3Comments