yera.providers.azure_common
Shared Azure credential and logging helpers.
Centralises credential construction so setup, discovery, and runtime all acquire tokens against the same tenant. Azure OpenAI supports AAD bearer tokens natively, so Yera never stores an API key for this provider.
Symbols
build_azure_credential
build_azure_credential(
tenant_id: str,
) → DefaultAzureCredentialBuild a DefaultAzureCredential pinned to a specific tenant.
additionally_allowed_tenants ensures the credential chain can
acquire tokens for tenant_id even when the active Azure CLI
context points elsewhere — which is the common failure mode for
users with multiple Azure identities.
Parameters
The AAD tenant UUID this credential should target.
Returns
A DefaultAzureCredential that will try managed identity, workload identity, env vars, Azure CLI, and developer tools in order — all constrained to the given tenant.
build_azure_openai_client
build_azure_openai_client(
connection: AzureConnection,
) → OpenAIBuild an OpenAI client for Azure's stable v1 data plane.
Constructs a tenant-pinned credential, wraps it in a token provider scoped to the Azure AI data plane, and supplies that provider to the ordinary OpenAI client. Azure's stable v1 endpoint does not require a dated API-version parameter.
Parameters
Azure connection supplying the tenant ID and endpoint URL.
Returns
An OpenAI client configured for the Azure v1 endpoint with Entra token-based authentication.
suppress_azure_logging
suppress_azure_logging() → NoneSilence chatty INFO-level logs from the Azure SDK chain.
DefaultAzureCredential logs every credential method it tries — and, when unauthenticated, every one it fails — on azure.identity, at WARNING. The token library (msal) and the HTTP pipeline add more. Raising the threshold to ERROR keeps genuine failures visible while dropping the per-attempt noise.
Call before any operation that touches azure.* modules.