Skip to content

Python Example - Upload a file to Azure Blob Storage using SAS token / SAS url

License

Notifications You must be signed in to change notification settings

rahulbagal/upload-file-azure-sas-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Storage - Upload File - Python

Forks Stargazers Issues MIT License

Upload File to Azure Blob Storage using SAS token / SAS url

Azure Blob Storage can be access using SAS ( shared access signatures) token.

This code is used in scenarios such as, SAS URL / SAS token is issued by one application to another application. Receiving application uploads a file to blob storage using that SAS token.

  • Pass SAS url & file name with path to function upload_using_sas(sas_url , file_name_full_path)
  • Its parses SAS url and sends file using HTTP PUT request.
  • It also recognizes content type from file extension.
  • Returns upload status as HTTP status code ( 201 - Accepted is success )

Install following packages referenced in the code

pip install requests 
pip install azure-storage-blob

Refer code from main.py to know how to use this function.

About

Python Example - Upload a file to Azure Blob Storage using SAS token / SAS url

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages