I already know how to create a download link using SAS to create a downloadable link for a Blob in Azure as per the docs. Using this code:
sas = generate_blob_sas(
account_name="account",
container_name="container",
blob_name="myblob",
account_key="accountKey",
permission=BlobSasPermissions(read=True),
expiry=datetime.utcnow() + timedelta(hours=1)
)
blob_url = f'https://account.blob.core.windows.net/container/a?{sas}'
However is this possible for File shares too? I want to create the sas
but for a File Share
Update:
I was able to do it from the Azure Storage Explorer, by right clicking on the file and clicking "Get Shared Access Signature".
I also then tried to use the code:
sas_token = generate_account_sas(
account_name="acc",
account_key="key",
resource_types=ResourceTypes(service=True),
permission=AccountSasPermissions(read=True),
expiry=datetime.utcnow() + timedelta(hours=1)
)
But this did not work.