1
votes

How do i create a shared access signature for Azure blobs with Access setting 'Blob(anonymous read access for blob only) '.

I came across this https://docs.microsoft.com/en-us/azure/storage/blobs/storage-dotnet-shared-access-signature-part-2 link and many links in stackoverflow. I could only see example for c# . How do i create an SAS in python ?

I have excel files present inside a blob storage and i need to access them from python

from azure.storage.blob import BlockBlobService
block_blob_service = BlockBlobService(account_name='name1', account_key='key1') 
blob_url = block_blob_service.make_blob_url('blob1','file1')

Now how i can access this file from blob with Access setting "Blob(anonymous read access for blob only) ?

1

1 Answers

1
votes

Not fully understand what you want. Do you want to create a link with SAS for this blob?

You should first create a SAS by block_blob_service.generate_blob_shared_access_signature, and then pass this SAS to block_blob_service.make_blob_url(..., sas_token=your_generated_one)