yera.cli.setup_handlers.azure
Azure OpenAI provider setup handler.
Symbols
AzureSetup
BaseProviderSetupHandler for configuring Azure OpenAI provider connections.
This class provides mechanisms to automatically discover Azure OpenAI resources across all accessible subscriptions or to manually configure a specific connection via user input.
Methods
AzureSetup.detect_config
detect_config() → AzureConnection | NoneAttempts to automatically detect Azure OpenAI configuration.
Uses the Azure SDK to discover all OpenAI accounts the current authenticated identity has access to. If multiple are found, it prompts the user to select one.
Returns
An AzureConnection instance if a resource is successfully discovered and selected; otherwise, None.
AzureSetup.ask_for_config
ask_for_config() → AzureConnection | NoneInteractively prompts the user for Azure OpenAI connection details.
Collects required metadata including the endpoint, resource name, subscription ID, tenant ID, and resource group.
Returns
An AzureConnection instance containing the user-provided details, or None if the user declines the setup.
AzureSetup.validate
validate(
config: AzureConnection,
) → NoneValidates the Azure connection by attempting to acquire an AD token.
This method verifies that the provided tenant ID is valid and that the current environment identity has permission to request a token for the Cognitive Services scope.
Parameters
The Azure connection configuration to validate.
Raises
If a token cannot be acquired for the specified tenant.