azure icon indicating copy to clipboard operation
azure copied to clipboard

Ensure trailing slash on base_url

Open ChandlerSwift opened this issue 3 years ago • 2 comments

SUMMARY

Ensure trailing slash on base_url

The AZURE_CHINA_CLOUD.endpoints.resource_manager and AZURE_GERMAN_CLOUD.endpoints.resource_manager URLs don't end with a trailing slash, but the AZURE_PUBLIC_CLOUD and AZURE_US_GOV_CLOUD URLs do. This commit ensures consistency despite that.

https://github.com/Azure/msrestazure-for-python/blob/8849f398b6ebd4607de63c2f5d1318f44ec1d822/msrestazure/azure_cloud.py#L137

Without this, base_url is set to 'https://management.chinacloudapi.cn':

https://github.com/ansible-collections/azure/blob/256ed011ea3d2e15616529034f53078dcefd9d2d/plugins/module_utils/azure_rm_common.py#L877

And then credential_scopes is set to [base_url + ".default"]:

https://github.com/ansible-collections/azure/blob/256ed011ea3d2e15616529034f53078dcefd9d2d/plugins/module_utils/azure_rm_common.py#L892

Which results in an invalid credential_scopes of ["https://management.chinacloudapi.cn.default"] rather than ["https://management.chinacloudapi.cn/.default"].

Fix also submitted upstream: https://github.com/Azure/msrestazure-for-python/pull/169

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

azure_rm_common

ChandlerSwift avatar Sep 21 '22 18:09 ChandlerSwift

@ChandlerSwift Any update for this ?

Fred-sun avatar Oct 11 '22 23:10 Fred-sun

@ChandlerSwift Any update for this ?

I'm sorry -- I didn't realize this was waiting on me. Please let me know what I can do to get this ready to merge!

ChandlerSwift avatar Oct 14 '22 22:10 ChandlerSwift

@ChandlerSwift LGTM

xuzhang3 avatar Nov 30 '22 05:11 xuzhang3