Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.39k stars 2.72k forks source link

Documentation and Errors around Unlisted Authorities are Missing/Wrong #35509

Open mrm9084 opened 2 months ago

mrm9084 commented 2 months ago

Describe the bug When attempting to use an Azure Authority Host that isn't part of this class: https://github.com/Azure/azure-sdk-for-python/blob/34795f552c643b916c648c6aa996ef2be3a03a81/sdk/identity/azure-identity/azure/identity/_constants.py#L17

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.

github-actions[bot] commented 2 months ago

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