Search code examples
javaazureazure-billing-api

How to get regionInfo for a subscription from Azure usage API?


The rate card API for Microsoft Azure's billing API:

https://management.azure.com/subscriptions/{subscription-Id}/providers/Microsoft.Commerce/RateCard?api-version={api-version}&$filter=OfferDurableId eq ’{OfferDurableId}’ and Currency lt ’{Currency}’ and Locale eq ’{Locale}’ and RegionInfo eq ’{RegionInfo}’’

requires the regionInfo to be provided for each request. The regionInfo, according to the documentation, refers to the location where the offer was purchased (offer referring to the OfferDurableId). The OfferDurableId can be obtained from the subscription and subsequently from here. However, I didn't find the regionInfo anywhere.

How to get the regionInfo for a subscription?

N.B.: I have raised an issue on the API's github repository.


Solution

  • Find out the purchase location as follows:

    Login in the Azure Portal. In the top right corner, click on your username and then choose "View my bill." This will open account.windowsazure.com. Choose profile. Your country code will be there.

    Hi UserName. Your email is some@domain.ca. The address we have on file is ISO Country Code. Your company is Company Name.

    Also, you an look up the two digit ISO region code here: https://www.iso.org/obp/ui/#search For instance, Canada is CA in the ISO list