Skip to content

Instantly share code, notes, and snippets.

@codingoutloud
Created March 3, 2017 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingoutloud/d369888e7426e86e9192ccd9d5666b52 to your computer and use it in GitHub Desktop.
Save codingoutloud/d369888e7426e86e9192ccd9d5666b52 to your computer and use it in GitHub Desktop.
from azure.servicemanagement import *
import platform
import os
plat = platform.system()
print("Platform == " + plat)
if plat != 'Windows':
certificate_path = './azquota.pem' # other than Windows
else:
certificate_path = 'CURRENT_USER\\my\\LabX' # Windows only
subscription_id = '1d29d4d6-b128-44bb-b644-a3204eb444be'
sms = ServiceManagementService(subscription_id, certificate_path)
sub_quota = sms.get_subscription();
print('Subscription: %s' % subscription_id);
#print('Account %s:' % sub_quota.);
print('Using %s of %s cores' % (sub_quota.current_core_count, sub_quota.max_core_count))
print('Using %s of %s hosted services' % (sub_quota.current_hosted_services, sub_quota.max_hosted_services))
print('Using %s of %s storage accounts' % (sub_quota.current_storage_accounts, sub_quota.max_storage_accounts))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment