Retrive subscription id from env (#42036)

pull/42045/head
Yuwei Zhou 7 years ago committed by Yunge Zhu
parent fa2366079a
commit 60ea14fe1f

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

Loading…
Cancel
Save