1

Calls to https://s2.billing.ext.azure.com/api/Billing/Subscription/GetSpecsCosts?api-version=2019-01-14 on the portal blade are succedding but with null pricing costs in the response.

The problem seems to be with this one particular subscription.

Is there any reason why a particular subscription should not get billing costs yet other subscriptions do?

2 Answers2

0

What type of subscription is this?

Prices are only available for pay-as-you-go (PAYG), Enterprise Agreement (EA), and Microsoft Customer Agreement (MCA) subscriptions today. Prices aren't available for Cloud Solution Provider (CSP) subscriptions. Also note access to prices/costs can be disabled for Enterprise Agreement (EA) or Microsoft Customer Agreement (MCA) subscriptions, but this would apply to all subscriptions in the billing account.

https://learn.microsoft.com/en-us/azure/cost-management/assign-access-acm-data#enable-access-to-costs-in-the-ea-portal

Michael Flanakin
  • 472
  • 1
  • 5
  • 18
0
You need to pass the correct specResourceSets in the request body along with the subscriptionId.

The request body will look like this:

{
    "subscriptionId": "<pass subscription id here>",
    "specResourceSets": [{
        "id": "Standard_D2s_v3",
        "firstParty": [{
            "id": "Standard_D2s_v3",
            "resourceId": "671fdefb-f93c-446c-9e1a-bcbeb12b9d13",
            "quantity": 730
        }],
        "thirdParty": []
    }],
    "specsToAllowZeroCost": `enter code here`["Standard_D2s_v3"],
    "specType": "Microsoft_Azure_Compute"
}
Narayan Periwal
  • 89
  • 1
  • 10