AzureBlockBlobBackend
Azure Storage Block Blob backend for Celery.
Attributes
| Attribute | Type | Description |
|---|---|---|
| _connection_string | string | The Azure Storage connection string or credential URI used to authenticate with the blob service. |
| _container_name | string | The name of the Azure Blob Storage container where task results and metadata are stored. |
| base_path | string | An optional prefix prepended to all blob keys to organize data within the container. |
| _connection_timeout | integer = 20 | The maximum number of seconds to wait for a connection to the Azure Storage endpoint to be established. |
| _read_timeout | integer = 120 | The maximum number of seconds to wait for a response from the Azure Storage service after a connection is established. |
Constructor
Signature
def AzureBlockBlobBackend(
url: str = None,
container_name: str = None,
*args: any,
**kwargs: any
)
Parameters
| Name | Type | Description |
|---|---|---|
| url | str = None | The connection URL or string for the Azure Storage account. |
| container_name | str = None | The name of the Azure Blob container to use. |
| *args | any | Variable length argument list passed to the parent class. |
| **kwargs | any | Arbitrary keyword arguments passed to the parent class. |
Signature
def AzureBlockBlobBackend(
url: string = None,
container_name: string = None
)
Parameters
| Name | Type | Description |
|---|---|---|
| url | string = None | The connection URL containing the connection string or credential type and storage account URL. |
| container_name | string = None | The name of the Azure Blob storage container where data will be stored. |
Methods
get()
@classmethod
def get(
key: string
) - > string
Read the value stored at the given key.
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | The key for which to read the value. |
Returns
| Type | Description |
|---|---|
string | The decoded string content of the blob, or None if the blob does not exist. |
set()
@classmethod
def set(
key: string,
value: bytes
)
Store a value for a given key.
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | The key at which to store the value. |
| value | bytes | The value to store. |
mget()
@classmethod
def mget(
keys: list
) - > list
Read all the values for the provided keys.
Parameters
| Name | Type | Description |
|---|---|---|
| keys | list | The list of keys to read. |
Returns
| Type | Description |
|---|---|
list | A list of values corresponding to the provided keys in the same order. |
delete()
@classmethod
def delete(
key: string
)
Delete the value at a given key.
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | The key of the value to delete. |
as_uri()
@classmethod
def as_uri(
include_password: boolean
) - > string
Returns the backend connection URI, optionally redacting sensitive credentials.
Parameters
| Name | Type | Description |
|---|---|---|
| include_password | boolean | Whether to include the raw AccountKey in the returned URI string. |
Returns
| Type | Description |
|---|---|
string | The full URI string, with the AccountKey masked if include_password is False. |