Azure Blob Storage#
|
Interface to a Microsoft Azure Blob Storage container. |
Configuration parameters for AzureStore. |
|
A shared Azure Storage Account Key. |
|
A shared access signature. |
|
An authorization token. |
|
Represent a PEP 604 union type |
|
|
A type hint for a synchronous or asynchronous callback to provide custom Azure credentials. |
- class vortex.store.AzureStore(container_name: str | None = None, *, prefix: str | None = None, config: AzureConfig | None = None, client_options: ClientConfig | None = None, retry_config: RetryConfig | None = None, credential_provider: AzureCredentialProvider | None = None, **kwargs: Unpack[AzureConfig])#
Interface to a Microsoft Azure Blob Storage container.
All constructors will check for environment variables. Refer to
AzureConfigfor valid environment variables.- property client_options: ClientConfig | None#
Get the store’s client configuration.
- property config: AzureConfig#
Get the underlying Azure config parameters.
- property credential_provider: AzureCredentialProvider | None#
Get the store’s credential provider.
- classmethod from_url(url: str, *, prefix: str | None = None, config: AzureConfig | None = None, client_options: ClientConfig | None = None, retry_config: RetryConfig | None = None, credential_provider: AzureCredentialProvider | None = None, **kwargs: Unpack[AzureConfig]) Self#
Construct a new AzureStore with values populated from a well-known storage URL.
Any path on the URL will be assigned as the
prefixfor the store. So if you passhttps://<account>.blob.core.windows.net/<container>/path/to/directory, the store will be created with a prefix ofpath/to/directory, and all further operations will use paths relative to that prefix.The supported url schemes are:
abfs[s]://<container>/<path>(according to fsspec)abfs[s]://<file_system>@<account_name>.dfs.core.windows.net/<path>abfs[s]://<file_system>@<account_name>.dfs.fabric.microsoft.com/<path>az://<container>/<path>(according to fsspec)adl://<container>/<path>(according to fsspec)azure://<container>/<path>(custom)https://<account>.dfs.core.windows.nethttps://<account>.blob.core.windows.nethttps://<account>.blob.core.windows.net/<container>https://<account>.dfs.fabric.microsoft.comhttps://<account>.dfs.fabric.microsoft.com/<container>https://<account>.blob.fabric.microsoft.comhttps://<account>.blob.fabric.microsoft.com/<container>
- Parameters:
url – well-known storage URL.
- Keyword Arguments:
prefix – A prefix within the bucket to use for all operations.
config – Azure Configuration. Values in this config will override values inferred from the url. Defaults to None.
client_options – HTTP Client options. Defaults to None.
retry_config – Retry configuration. Defaults to None.
credential_provider – A callback to provide custom Azure credentials.
kwargs – Azure configuration values. Supports the same values as
config, but as named keyword args.
- Returns:
AzureStore
- property retry_config: RetryConfig | None#
Get the store’s retry configuration.
- class vortex.store.AzureConfig#
Configuration parameters for AzureStore.
- account_key: str#
Master key for accessing storage account.
Environment variables:
AZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_ACCESS_KEYAZURE_STORAGE_MASTER_KEY
- account_name: str#
The name of the azure storage account. (Required.)
Environment variable:
AZURE_STORAGE_ACCOUNT_NAME.
- authority_host: str#
Sets an alternative authority host for OAuth based authorization.
Defaults to
https://login.microsoftonline.com.Common hosts for azure clouds are:
Azure China:
"https://login.chinacloudapi.cn"Azure Germany:
"https://login.microsoftonline.de"Azure Government:
"https://login.microsoftonline.us"Azure Public:
"https://login.microsoftonline.com"
Environment variables:
AZURE_STORAGE_AUTHORITY_HOSTAZURE_AUTHORITY_HOST
- client_id: str#
The client id for use in client secret or k8s federated credential flow.
Environment variables:
AZURE_STORAGE_CLIENT_IDAZURE_CLIENT_ID
- client_secret: str#
The client secret for use in client secret flow.
Environment variables:
AZURE_STORAGE_CLIENT_SECRETAZURE_CLIENT_SECRET
- disable_tagging: bool#
If set to
Truewill ignore any tags provided to uploads.Environment variable:
AZURE_DISABLE_TAGGING.
- endpoint: str#
Override the endpoint used to communicate with blob storage.
Defaults to
https://{account}.blob.core.windows.net.By default, only HTTPS schemes are enabled. To connect to an HTTP endpoint, enable
allow_httpin the client options.Environment variables:
AZURE_STORAGE_ENDPOINTAZURE_ENDPOINT
- fabric_cluster_identifier: str#
Cluster identifier for Fabric OAuth2 authentication.
Environment variable:
AZURE_FABRIC_CLUSTER_IDENTIFIER.
- fabric_session_token: str#
Session token for Fabric OAuth2 authentication.
Environment variable:
AZURE_FABRIC_SESSION_TOKEN.
- fabric_token_service_url: str#
Service URL for Fabric OAuth2 authentication.
Environment variable:
AZURE_FABRIC_TOKEN_SERVICE_URL.
- fabric_workload_host: str#
Workload host for Fabric OAuth2 authentication.
Environment variable:
AZURE_FABRIC_WORKLOAD_HOST.
- federated_token_file: str#
Sets a file path for acquiring azure federated identity token in k8s.
Requires
client_idandtenant_idto be set.Environment variable:
AZURE_FEDERATED_TOKEN_FILE.
- msi_endpoint: str#
Endpoint to request a imds managed identity token.
Environment variables:
AZURE_MSI_ENDPOINTAZURE_IDENTITY_ENDPOINT
- msi_resource_id: str#
Msi resource id for use with managed identity authentication.
Environment variable:
AZURE_MSI_RESOURCE_ID.
- object_id: str#
Object id for use with managed identity authentication.
Environment variable:
AZURE_OBJECT_ID.
- sas_key: str#
Shared access signature.
The signature is expected to be percent-encoded, much like they are provided in the azure storage explorer or azure portal.
Environment variables:
AZURE_STORAGE_SAS_KEYAZURE_STORAGE_SAS_TOKEN
- skip_signature: bool#
If enabled,
AzureStorewill not fetch credentials and will not sign requests.This can be useful when interacting with public containers.
Environment variable:
AZURE_SKIP_SIGNATURE.
- tenant_id: str#
The tenant id for use in client secret or k8s federated credential flow.
Environment variables:
AZURE_STORAGE_TENANT_IDAZURE_STORAGE_AUTHORITY_IDAZURE_TENANT_IDAZURE_AUTHORITY_ID
- token: str#
A static bearer token to be used for authorizing requests.
Environment variable:
AZURE_STORAGE_TOKEN.
- use_azure_cli: bool#
Set if the Azure Cli should be used for acquiring access token.
Environment variable:
AZURE_USE_AZURE_CLI.
- use_emulator: bool#
Set if the Azure emulator should be used (defaults to
False).Environment variable:
AZURE_STORAGE_USE_EMULATOR.
- use_fabric_endpoint: bool#
Set if Microsoft Fabric url scheme should be used (defaults to
False).When disabled the url scheme used is
https://{account}.blob.core.windows.net. When enabled the url scheme used ishttps://{account}.dfs.fabric.microsoft.com.Note
endpointwill take precedence over this option.
- class vortex.store.AzureAccessKey#
A shared Azure Storage Account Key.
- class vortex.store.AzureSASToken#
A shared access signature.
- class vortex.store.AzureBearerToken#
An authorization token.
- vortex.store.AzureCredential#
alias of
AzureAccessKey|AzureSASToken|AzureBearerToken
- class vortex.store.AzureCredentialProvider(*args, **kwargs)#
A type hint for a synchronous or asynchronous callback to provide custom Azure credentials.
This should be passed into the
credential_providerparameter ofAzureStore.