Microsoft Azure
rustac.store.AzureStore
Interface to a Microsoft Azure Blob Storage container.
All constructors will check for environment variables. All environment variables
starting with AZURE_
will be evaluated. Names must match keys from
AzureConfig
. Only upper-case environment variables
are accepted.
Some examples of variables extracted from environment:
AZURE_STORAGE_ACCOUNT_NAME
: storage account nameAZURE_STORAGE_ACCOUNT_KEY
: storage account master keyAZURE_STORAGE_ACCESS_KEY
: alias forAZURE_STORAGE_ACCOUNT_KEY
AZURE_STORAGE_CLIENT_ID
-> client id for service principal authorizationAZURE_STORAGE_CLIENT_SECRET
-> client secret for service principal authorizationAZURE_STORAGE_TENANT_ID
-> tenant id used in oauth flows
__init__
__init__(
container: str | None = None,
*,
prefix: str | None = None,
config: AzureConfig | AzureConfigInput | None = None,
client_options: ClientConfig | None = None,
retry_config: RetryConfig | None = None,
credential_provider: AzureCredentialProvider | None = None,
**kwargs: Unpack[AzureConfigInput],
) -> None
Construct a new AzureStore.
Parameters:
-
container
(str | None
, default:None
) –the name of the container.
Other Parameters:
-
prefix
(str | None
) –A prefix within the bucket to use for all operations.
-
config
(AzureConfig | AzureConfigInput | None
) –Azure Configuration. Values in this config will override values inferred from the url. Defaults to None.
-
client_options
(ClientConfig | None
) –HTTP Client options. Defaults to None.
-
retry_config
(RetryConfig | None
) –Retry configuration. Defaults to None.
-
credential_provider
(AzureCredentialProvider | None
) –A callback to provide custom Azure credentials.
-
kwargs
(Unpack[AzureConfigInput]
) –Azure configuration values. Supports the same values as
config
, but as named keyword args.
Returns:
-
None
–AzureStore
from_url
classmethod
from_url(
url: str,
*,
prefix: str | None = None,
config: AzureConfig | AzureConfigInput | None = None,
client_options: ClientConfig | None = None,
retry_config: RetryConfig | None = None,
credential_provider: AzureCredentialProvider | None = None,
**kwargs: Unpack[AzureConfigInput],
) -> AzureStore
Construct a new AzureStore with values populated from a well-known storage URL.
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.net
https://<account>.blob.core.windows.net
https://<account>.blob.core.windows.net/<container>
https://<account>.dfs.fabric.microsoft.com
https://<account>.dfs.fabric.microsoft.com/<container>
https://<account>.blob.fabric.microsoft.com
https://<account>.blob.fabric.microsoft.com/<container>
Parameters:
-
url
(str
) –well-known storage URL.
Other Parameters:
-
prefix
(str | None
) –A prefix within the bucket to use for all operations.
-
config
(AzureConfig | AzureConfigInput | None
) –Azure Configuration. Values in this config will override values inferred from the url. Defaults to None.
-
client_options
(ClientConfig | None
) –HTTP Client options. Defaults to None.
-
retry_config
(RetryConfig | None
) –Retry configuration. Defaults to None.
-
credential_provider
(AzureCredentialProvider | None
) –A callback to provide custom Azure credentials.
-
kwargs
(Unpack[AzureConfigInput]
) –Azure configuration values. Supports the same values as
config
, but as named keyword args.
Returns:
-
AzureStore
–AzureStore
rustac.store.AzureAccessKey
Bases: TypedDict
A shared Azure Storage Account Key.
https://learn.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key
rustac.store.AzureConfig
Bases: TypedDict
Configuration parameters returned from AzureStore.config.
Note that this is a strict subset of the keys allowed for input into the store, see [AzureConfigInput][obstore.store.AzureConfigInput].
azure_federated_token_file
instance-attribute
File containing token for Azure AD workload identity federation
azure_msi_endpoint
instance-attribute
Endpoint to request a imds managed identity token
azure_msi_resource_id
instance-attribute
Msi resource id for use with managed identity authentication
azure_object_id
instance-attribute
Object id for use with managed identity authentication
azure_storage_account_key
instance-attribute
Master key for accessing storage account
azure_storage_account_name
instance-attribute
The name of the azure storage account
azure_storage_client_id
instance-attribute
Service principal client id for authorizing requests
azure_storage_client_secret
instance-attribute
Service principal client secret for authorizing requests
azure_storage_endpoint
instance-attribute
Override the endpoint used to communicate with blob storage
azure_storage_sas_key
instance-attribute
Shared access signature.
The signature is expected to be percent-encoded, much
like they are provided in
the azure storage explorer or azure portal.
azure_storage_tenant_id
instance-attribute
Tenant id used in oauth flows
azure_storage_use_emulator
instance-attribute
Use object store with azurite storage emulator
azure_use_azure_cli
instance-attribute
Use azure cli for acquiring access token
rustac.store.AzureSASToken
Bases: TypedDict
A shared access signature.
rustac.store.AzureBearerToken
Bases: TypedDict
An authorization token.
https://learn.microsoft.com/en-us/rest/api/storageservices/authorize-with-azure-active-directory
rustac.store.AzureCredential
module-attribute
AzureCredential: TypeAlias = AzureAccessKey | AzureSASToken | AzureBearerToken
A type alias for supported azure credentials to be returned from AzureCredentialProvider
.
rustac.store.AzureCredentialProvider
Bases: Protocol
A type hint for a synchronous or asynchronous callback to provide custom Azure credentials.
This should be passed into the credential_provider
parameter of AzureStore
.
__call__
staticmethod
__call__() -> AzureCredential | Coroutine[Any, Any, AzureCredential]
Return an AzureCredential
.