diff --git a/changelogs/fragments/55745-azure_rm_common.yaml b/changelogs/fragments/55745-azure_rm_common.yaml new file mode 100644 index 00000000000..fe94de38266 --- /dev/null +++ b/changelogs/fragments/55745-azure_rm_common.yaml @@ -0,0 +1,2 @@ +bugfixes: + - Fix cannot get credential when `source_auth` set to `credential_file`. diff --git a/lib/ansible/module_utils/azure_rm_common.py b/lib/ansible/module_utils/azure_rm_common.py index 0115e31c699..530c0f1b864 100644 --- a/lib/ansible/module_utils/azure_rm_common.py +++ b/lib/ansible/module_utils/azure_rm_common.py @@ -1226,7 +1226,7 @@ class AzureRMAuth(object): if auth_source == 'credential_file': self.log("Retrieving credentials from credential file") - profile = params.get('profile', 'default') + profile = params.get('profile') or 'default' default_credentials = self._get_profile(profile) return default_credentials