AzureΒΆ
Azure authentication helpers for LM integrations.
Provides :func:get_default_azure_token_provider for Azure Entra ID auth and pre-defined scope constants for common Azure AI services:
- :data:
AZURE_COGNITIVE_SERVICES_SCOPEβ Azure OpenAI and Azure AI Foundry model inference endpoints (the default). - :data:
AZURE_AI_FOUNDRY_SCOPEβ Azure AI Foundry Agents API.
AttributesΒΆ
AZURE_COGNITIVE_SERVICES_SCOPE module-attribute ΒΆ
Token scope for Azure OpenAI and Azure AI Foundry model inference.
This is the correct scope for: - Azure OpenAI endpoints (*.openai.azure.com) - Azure AI Foundry model inference (*.api.<region>.cognitive.microsoft.com) - Azure AI Foundry Anthropic models (*.services.ai.azure.com/anthropic)
AZURE_AI_FOUNDRY_SCOPE module-attribute ΒΆ
Token scope for the Azure AI Foundry Agents API.
Use this scope when authenticating to Foundry Agent endpoints (*.services.ai.azure.com/api/projects/...). For standard model inference through Foundry, use :data:AZURE_COGNITIVE_SERVICES_SCOPE instead.
FunctionsΒΆ
get_default_azure_token_provider ΒΆ
get_default_azure_token_provider(*, scopes: tuple[str, ...] = _DEFAULT_AZURE_SCOPES, **credential_kwargs: Any) -> Callable[..., str]
Create an Azure bearer token provider backed by DefaultAzureCredential.
ParametersΒΆ
scopes: Token audience scope(s). Defaults to :data:AZURE_COGNITIVE_SERVICES_SCOPE which covers Azure OpenAI and Foundry model inference. Pass :data:AZURE_AI_FOUNDRY_SCOPE for the Foundry Agents API. **credential_kwargs: Forwarded to DefaultAzureCredential(...). Common options include managed_identity_client_id and exclude_environment_credential.