I am reading Azure RateCard prices from JSON stream (https://docs.microsoft.com/en-us/previous-versions/azure/reference/mt219005(v=azure.100)). JSON contains info about region this way: "MeterRegion": "US West Central". My problem is related to these values in MeterRegion. It looks like some "display name", not region "id". How to pair this MeterRegions to other systems?
E.g.: When using Microsoft.Azure.Management.ResourceManager.Fluent.Core.dll (https://github.com/Azure/azure-libraries-for-net) they provide list of regions containing Name="westcentralus", DisplayName="West Central US".
As you can see, 3 different values.
It looks like there is nothing like global Azure region ID?
(I hope I am asking in right place, there is not much info about RateCard JSON format, documentation,...)
Thank You
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@MiroslavVanicky Thanks for the comment. We are actively investigating on the issue and will get back to you shortly with an update.
@MiroslavVanicky Unfortunately there isn’t a global region Id, as you've noted different systems are using different region Ids.
@MiroslavVanicky We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.
@SadiqhAhmed-MSFT If there are "different systems are using different region Ids." where we can find some mapping? Is there some documentation for it? Any mapping library?
I cannot believe that I should compare all these documentation and hard-code it.
@qub1n,
What I have noticed is for 99% of cases, the "display name" of an Azure region (eg: "West US") is exactly the same as its region ID ("westus"). Simply remove all spaces from the display name and lowercase the result. You will get the region ID.
For somethings, you dont really need an API.
If you really want one, take a look at this:
https://docs.microsoft.com/en-us/rest/api/resources/subscriptions/listlocations
It returns both the region name and the region ID. So get that list, store it somewhere and use it to translate the names.
@SadiqhAhmed-MSFT - I thought you folks were experts in Azure :)
99% is still not systematic solution. If there is some global "region id" used it would be systematic. Otherwise you have to hardcode some logic of mapping "US West Central" VS "westcentralus" VS "West Central US". Also, new regions are being crated.
I dont see that as a show-stopper. The ListLocations API I linked to above already provides a display name to code mapping. It would be easy to extend that to map with strings with components switched around.
Thanks @sujayvsarma for proposing the above workaround. Super useful.
@MiroslavVanicky , @qub1n - you both bring up very valid points on having a global region ID. The Feature team will love to hear your feedback directly using this link. I strongly recommend sharing your feedback below using the abovementioned link.
" _If there is some global "region id" used it would be systematic. Otherwise you have to hardcode some logic of mapping "US West Central" VS "westcentralus" VS "West Central US". Also, new regions are being crated_"
In Parallel, i'm checking internally for a supported systemic fix that requires little to no additional logic.
Stay tuned.
@MiroslavVanicky, @qub1n - Got an update from the Subscription mgmt & billing support team. They will like to know more about your implementation details and have requested you please create a case for a deeper review which will hopefully yield a systemic solution. Use this link to create a case with the subscription mgmt. & Billing support team They are expecting you. :)
Most helpful comment
@MiroslavVanicky, @qub1n - Got an update from the Subscription mgmt & billing support team. They will like to know more about your implementation details and have requested you please create a case for a deeper review which will hopefully yield a systemic solution. Use this link to create a case with the subscription mgmt. & Billing support team They are expecting you. :)
