Retrive subscription id from env (#42036)

This commit is contained in:
Yuwei Zhou 2018-06-28 17:00:21 +08:00 committed by Yunge Zhu
parent fa2366079a
commit 60ea14fe1f

View file

@ -425,6 +425,7 @@ class AzureRM(object):
def _get_msi_credentials(self, subscription_id_param=None):
credentials = MSIAuthentication()
subscription_id_param = subscription_id_param or os.environ.get(AZURE_CREDENTIAL_ENV_MAPPING['subscription_id'], None)
try:
# try to get the subscription in MSI to test whether MSI is enabled
subscription_client = SubscriptionClient(credentials)