prefect_azure.credentials
Credential classes used to perform authenticated interactions with Azure
Classes
AzureBlobStorageCredentials
Stores credentials for authenticating with Azure Blob Storage.
Authentication can be done using one of the following methods:
- Connection string: Provide a connection string for your Azure storage account.
- Account URL with DefaultAzureCredential: Provide an account URL and credentials will be discovered automatically using DefaultAzureCredential.
- Account URL with Service Principal: Provide an account URL along with client_id, tenant_id, and client_secret for service principal authentication.
account_url: The URL for your Azure storage account. Required for DefaultAzureCredential or service principal authentication.connection_string: The connection string to your Azure storage account. If provided, the connection string will take precedence over the account URL.client_id: The service principal client ID. If provided, tenant_id and client_secret must also be provided.tenant_id: The service principal tenant ID. If provided, client_id and client_secret must also be provided.client_secret: The service principal client secret. If provided, client_id and tenant_id must also be provided.
aclose
check_connection_string_or_account_url
- connection_string only (no account_url, no SPN fields)
- account_url only (uses DefaultAzureCredential)
- account_url + client_id + tenant_id + client_secret (SPN auth)
get_blob_client
container: Name of the Blob Storage container to retrieve from.blob: Name of the blob within this container to retrieve.
get_client
get_container_client
container: Name of the Blob Storage container to retrieve from.
AzureCosmosDbCredentials
Block used to manage Cosmos DB authentication with Azure.
Azure authentication is handled via the azure module through
a connection string.
Args:
connection_string: Includes the authorization information required.
get_client
get_container_client
container: Name of the Cosmos DB container to retrieve from.database: Name of the Cosmos DB database.
get_database_client
database: Name of the database.
AzureMlCredentials
Block used to manage authentication with AzureML. Azure authentication is
handled via the azure module.
Args:
tenant_id: The active directory tenant that the service identity belongs to.service_principal_id: The service principal ID.service_principal_password: The service principal password/key.subscription_id: The Azure subscription ID containing the workspace.resource_group: The resource group containing the workspace.workspace_name: The existing workspace name.
get_workspace
AzureContainerInstanceCredentials
Block used to manage Azure Container Instances authentication. Stores Azure Service
Principal authentication data.
Methods:
get_container_client
subscription_id: A valid Azure subscription ID.
- An initialized
ContainerInstanceManagementClient
get_resource_client
subscription_id: A valid Azure subscription ID.
- An initialized
ResourceManagementClient
validate_credential_kwargs
client_id, tenant_id, or client_secret are
provided, all must be provided.
AzureDevopsCredentials
Block used to authenticate with Azure DevOps using a Personal Access Token.
Attributes:
token: A Personal Access Token generated from Azure DevOps.