diff --git a/plugins/module_utils/azure_rm_common.py b/plugins/module_utils/azure_rm_common.py index 1c2347987..3ffa5bca5 100644 --- a/plugins/module_utils/azure_rm_common.py +++ b/plugins/module_utils/azure_rm_common.py @@ -1525,14 +1525,13 @@ def __init__(self, auth_source=None, profile=None, subscription_id=None, client_ elif self.credentials.get('ad_user') is not None and self.credentials.get('password') is not None: tenant = self.credentials.get('tenant') + tenant_track2 = self.credentials.get('tenant') if not tenant: tenant = 'common' # SDK default tenant_track2 = 'organizations' # SDK default - else: - tenant_track2 = self.credentials.get('tenant') - self.azure_credentials = UserPassCredentials(self.credentials['ad_user'], - self.credentials['password'], + self.azure_credentials = UserPassCredentials(username=self.credentials['ad_user'], + password=self.credentials['password'], tenant=tenant, cloud_environment=self._cloud_environment, verify=self._cert_validation_mode == 'validate')