Skip to main content

AzureBlockBlobBackend

Azure Storage Block Blob backend for Celery.

Attributes​

AttributeTypeDescription
_connection_stringstringThe Azure Storage connection string or credential URI used to authenticate with the blob service.
_container_namestringThe name of the Azure Blob Storage container where task results and metadata are stored.
base_pathstringAn optional prefix prepended to all blob keys to organize data within the container.
_connection_timeoutinteger = 20The maximum number of seconds to wait for a connection to the Azure Storage endpoint to be established.
_read_timeoutinteger = 120The 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​

NameTypeDescription
urlstr = NoneThe connection URL or string for the Azure Storage account.
container_namestr = NoneThe name of the Azure Blob container to use.
*argsanyVariable length argument list passed to the parent class.
**kwargsanyArbitrary keyword arguments passed to the parent class.

Signature​

def AzureBlockBlobBackend(
url: string = None,
container_name: string = None
)

Parameters​

NameTypeDescription
urlstring = NoneThe connection URL containing the connection string or credential type and storage account URL.
container_namestring = NoneThe 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​

NameTypeDescription
keystringThe key for which to read the value.

Returns​

TypeDescription
stringThe 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​

NameTypeDescription
keystringThe key at which to store the value.
valuebytesThe value to store.

mget()​

@classmethod
def mget(
keys: list
) - > list

Read all the values for the provided keys.

Parameters​

NameTypeDescription
keyslistThe list of keys to read.

Returns​

TypeDescription
listA 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​

NameTypeDescription
keystringThe 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​

NameTypeDescription
include_passwordbooleanWhether to include the raw AccountKey in the returned URI string.

Returns​

TypeDescription
stringThe full URI string, with the AccountKey masked if include_password is False.