octodns / octodns-azure

Azure DNS provider for octoDNS
MIT License
6 stars 12 forks source link

base_url not work #102

Open guochao-chen opened 1 month ago

guochao-chen commented 1 month ago

When I use "class: octodns_azure.AzurePrivateProvider", I set the base_url: "https://management.chinacloudapi.cn" to use Azure China API. It did not work, still used the default API "https://management.azure.com", reported error Image "azure.core.exceptions.ClientAuthenticationError: Authentication failed: AADSTS500011: The resource principal named https://management.azure.com was not found in the tenant named "

add code "credential_scopes = [self._base_url + "/.default"]" into the init.py , it was fixed. Image

Is it an issue?

ross commented 1 month ago

That seems like an issue and a good fix. Do you know if the same needs to happen for the non-private client path:

https://github.com/octodns/octodns-azure/blob/dea29fe2f440484884982ec560b6104bf342cf18/octodns_azure/__init__.py#L990-L995

A PR would be welcome. I won't be able to test it against Azure China, but I can verify that it still works correctly with the default.