mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Retrive subscription id from env (#42036)
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user