I'm trying to list the subscriptions in an Azure account using azure-python-sdk.
I have followed this link in documentation.
from azure.mgmt.subscription import SubscriptionClient
from msrestazure.azure_active_directory import UserPassCredentials
credentials = UserPassCredentials(username='xxxx', password='xxxx')
sub_client = SubscriptionClient(credentials)
subs = [sub.as_dict() for sub in sub_client.subscriptions.list()]
print(subs)
It is supposed to return a list of subscriptions. However, I see only empty list returned every time I try the above code. Can anybody help?