Azure Forecast Rest Api Returning Error code 404: “Cost management data is not supported for subscription”

1.2k views Asked by At

I'm trying to use the azure forecast rest API of version "2019-10-01".And the Version which I'm using is the latest version.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts?$filter={$filter}&api-version=2019-10-01

I am able to get the forecast details for other subscription but unable to get the response for a specific subscription id cxxxxx-xxxx-xxx-xxxxxxxxxxxx8.Please someone help to resolve this issue.

Error message:: {'error': {'code': '404', 'message': 'Cost management data is not supported for subscription(s) cxxxxx-xxxx-xxx-xxxxxxxxxxxx8 in the provided api-version. Please use api-version 2019-10-01 or later. (Request ID: 0cd6dd95-642d-4de0-9f31-5b2897ef2c61)'}}

1

There are 1 answers

1
Satya V On

I would go and check the subscription type for which it is not working.

You're most likely to encounter this issue if the subscription type is of one of the below :

MS-AZR-0145P (CSP)
MS-AZR-0146P (CSP)
MS-AZR-159P (CSP)
MS-AZR-0036P (sponsored)
MS-AZR-0143P (sponsored)
MS-AZR-0015P (internal)
MS-AZR-0144P (DreamSpark)

The above offer id/subscription types are not supported by API.

To check from the portal,

Access portal.azure.com --> Subscriptions

enter image description here

Find the subscription that is not working and click the same. You could the offer ID in the resulting page under the Essentials.