mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Retrive subscription id from env (#42036)
This commit is contained in:
parent
fa2366079a
commit
60ea14fe1f
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue