0
votes

Currently Azure exposes one API to fetch all of the VM Sizes. The API is dependent on a parameter i.e location.

Microsoft Documentation

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version=2017-12-01

Is there a way I can fetch all the VM Sizes without passing the location? i.e is there a way I can find out all the VM sizes irrespective of any location? Thanks for any help in advance!

1
No, this doesnt make sense, as some location dont have all the vms. if oyu are looking for a list of all possible vm sizes your best bet is documentation4c74356b41

1 Answers

0
votes

You first list the locations in the subscription. https://docs.microsoft.com/en-us/rest/api/resources/subscriptions/listlocations

Then for each location you list the VM sizes. You can keep track of duplicates yourself of VM sizes that exist in multiple locations. https://docs.microsoft.com/en-us/rest/api/compute/virtualmachinesizes/list

You can see the answer here for example of how to list locations.