azureazure-billing-apiazure-gov

Are the Azure usage and rate card APIs supported for US GOV EA subscriptions?


I have a client with a Azure subscription sitting in a US GOV data center. This subscription is under an EA (not pay-as-you-go).

Attempting to use the standard billing APIs (ratecard and usage) fails with a 'Subscription not found' error. I.e. running the following:

https://management.azure.com/subscriptions/[subscription id here]/providers/Microsoft.Commerce/RateCard?api-version=2015-06-01-preview&$filter=OfferDurableId eq 'MS-AZR-USGOV-0017P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'

fails with:

{
    "error": {
        "code": "SubscriptionNotFound",
        "message": "The subscription '[subscription id here]' could not be found."
    }
}

I've found very little information on the rate card and usage APIs with EA accounts and even less information on these APIs for accounts running in a US GOV Azure region. Does anyone know if this is supposed to work?


Solution

  • I don't have any experience with the Gov environment, but otherwise my experience is that Resource Usage API also works for EA, whereas the RateCard does not. I would suggest you to start out with the powershell cmdlets for an easy start * Get-AzureRmUsage https://learn.microsoft.com/en-us/powershell/resourcemanager/azurerm.insights/v2.3.0/get-azurermusage

    Be sure that you have powershell running correctly towards the Government environment first. If you want to roll your own client remember to use the correct endpoints as described in "Azure Government developer guide" https://learn.microsoft.com/en-us/azure/azure-government-developer-guide

    Brgds Brian