diff --git a/plugins/module_utils/azure_rm_common.py b/plugins/module_utils/azure_rm_common.py index 4b034838e..05799742c 100644 --- a/plugins/module_utils/azure_rm_common.py +++ b/plugins/module_utils/azure_rm_common.py @@ -876,6 +876,12 @@ def get_mgmt_svc_client(self, client_type, base_url=None, api_version=None, supp # most things are resource_manager, don't make everyone specify base_url = self.azure_auth._cloud_environment.endpoints.resource_manager + # https://github.com/Azure/msrestazure-for-python/pull/169 + # China's base_url doesn't end in a trailing slash, though others do, + # and we need a trailing slash when generating credential_scopes below. + if not base_url.endswith("/"): + base_url += "/" + mgmt_subscription_id = self.azure_auth.subscription_id if self.module.params.get('subscription_id'): mgmt_subscription_id = self.module.params.get('subscription_id')