aztk/utils/helpers.py
def upload_blob_and_create_sas(container_name, blob_name, file_name, expiry, blob_client, timeout=None):
    """
    Uploads a file from local disk to Azure Storage and creates a SAS for it.
    :param blob_client: The storage block blob client to use.
    :type blob_client: `azure.storage.blob.BlockBlobService`
    :param str container_name: The name of the container to upload the blob to.
    :param str blob_name: The name of the blob to upload the local file to.
    :param str file_name: The name of the local file to upload.
    :param expiry: The SAS expiry time.
    :type expiry: `datetime.datetime`
    :param int timeout: timeout in minutes from now for expiry,
        will only be used if expiry is not specified
    :return: A SAS URL to the blob with the specified expiry time.
    :rtype: str
    """
    blob_client.create_container(container_name, fail_on_exist=False)

    blob_client.create_blob_from_path(container_name, blob_name, file_name)

    sas_token = create_sas_token(
        container_name,
        blob_name,
        permission=blob.BlobPermissions.READ,
        blob_client=None,
        expiry=expiry,
        timeout=timeout,
    )

    sas_url = blob_client.make_blob_url(container_name, blob_name, sas_token=sas_token)

    return sas_url

    Uploads a file from local disk to Azure Storage and creates a SAS for it.
    :param blob_client: The storage block blob client to use.
    :type blob_client: `azure.storage.blob.BlockBlobService`
    :param str container_name: The name of the container to upload the blob to.
    :param str blob_name: The name of the blob to upload the local file to.
    :param str file_name: The name of the local file to upload.
    :param expiry: The SAS expiry time.
    :type expiry: `datetime.datetime`
    :param int timeout: timeout in minutes from now for expiry,
        will only be used if expiry is not specified
    :return: A SAS URL to the blob with the specified expiry time.
    :rtype: str
    
Uploads a file from local disk to Azure Storage and creates a SAS for it.
Uploads a file from local disk to Azure Storage and creates a SAS for it .
def upload_blob_and_create_sas(container_name, blob_name, file_name, expiry, blob_client, timeout=None):
    blob_client.create_container(container_name, fail_on_exist=False)
    blob_client.create_blob_from_path(container_name, blob_name, file_name)
    sas_token = create_sas_token(
        container_name,
        blob_name,
        permission=blob.BlobPermissions.READ,
        blob_client=None,
        expiry=expiry,
        timeout=timeout,
    )
    sas_url = blob_client.make_blob_url(container_name, blob_name, sas_token=sas_token)
    return sas_url
def upload_blob_and_create_sas ( container_name , blob_name , file_name , expiry , blob_client , timeout = None ) : blob_client . create_container ( container_name , fail_on_exist = False ) blob_client . create_blob_from_path ( container_name , blob_name , file_name ) sas_token = create_sas_token ( container_name , blob_name , permission = blob . BlobPermissions . READ , blob_client = None , expiry = expiry , timeout = timeout , ) sas_url = blob_client . make_blob_url ( container_name , blob_name , sas_token = sas_token ) return sas_url
Uploads a file from local disk to Azure Storage and creates a SAS for it.
Uploads a file from local disk to Azure Storage and creates a SAS for it .
"""
    Uploads a file from local disk to Azure Storage and creates a SAS for it.
    :param blob_client: The storage block blob client to use.
    :type blob_client: `azure.storage.blob.BlockBlobService`
    :param str container_name: The name of the container to upload the blob to.
    :param str blob_name: The name of the blob to upload the local file to.
    :param str file_name: The name of the local file to upload.
    :param expiry: The SAS expiry time.
    :type expiry: `datetime.datetime`
    :param int timeout: timeout in minutes from now for expiry,
        will only be used if expiry is not specified
    :return: A SAS URL to the blob with the specified expiry time.
    :rtype: str
    """
A SAS URL to the blob with the specified expiry time.
A SAS URL to the blob with the specified expiry time .
str
container_name
The name of the container to upload the blob to.
The name of the container to upload the blob to .
blob_name
The name of the blob to upload the local file to.
The name of the blob to upload the local file to .
file_name
The name of the local file to upload.
The name of the local file to upload .
expiry
The SAS expiry time.
The SAS expiry time .
blob_client
The storage block blob client to use.
The storage block blob client to use .
timeout
timeout in minutes from now for expiry,
will only be used if expiry is not specified
timeout in minutes from now for expiry will only be used if expiry is not specified