Azure/azure-sdk-for-python

Documentation and Errors around Unlisted Authorities are Missing/Wrong

mrm9084 opened this issue · 1 comments

  • Package Name: azure-identity
  • Package Version: 1.16.0
  • Operating System: Windows 11
  • Python Version: 3.11.9

Describe the bug
When attempting to use an Azure Authority Host that isn't part of this class:

An error is given that the authority isn't whitelisted.

azure.core.exceptions.ClientAuthenticationError: Authentication failed: invalid_instance: The authority you provided,
https://<your-authority>/organizations
, is not whitelisted. If it is indeed your legit customized domain name, you can turn off this check by passing in validate_authority=False

If you attempt using validate_authority=False you get the same error. This also doesn't match the documentation here: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/README.md#cloud-configuration

To Reproduce

from azure.appconfiguration import AzureAppConfigurationClient
from azure.identity import AzureCliCredential

endpoint = "<your-endpoint>"
credential = <your-credential>

config = AzureAppConfigurationClient(endpoint, credential, instance_discovery=False)

print(config.get_configuration_setting("test"))

NOTE: App Configuration isn't required for this.

Expected behavior
The documentation and error message should be acurate. disable_instance_discovery=True seems to work.

Thank you for your feedback. Tagging and routing to the team member best able to assist.