Created
January 20, 2018 01:57
-
-
Save fitzgeraldsteele/b8adbcec2168d85f3bb71d8f109f739b to your computer and use it in GitHub Desktop.
Get a list of Azure VM Skus for a particular Azure region
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a list of Azure VM Skus for a particular region | |
from azure.common.client_factory import get_client_from_cli_profile | |
from azure.mgmt.compute import ComputeManagementClient | |
client = get_client_from_cli_profile(ComputeManagementClient) | |
SUBID = 'YOUR-SUBSCRIPTION-ID' | |
LOCATION = 'eastus2' | |
sizeitr = client.virtual_machine_sizes.list(LOCATION, subscription_id = SUBID) | |
sizes = [i.name for i in sizeitr] | |
sizesorted = sorted(sizes) | |
for s in sizesorted: | |
print(s) | |
print (len(sizesorted)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment