Microsoft Azure Storage Library for Python
zezha-msft Merge pull request #476 from Azure/dev
1.3.1 release for blob and file
Latest commit ff50b8b Jul 17, 2018
Failed to load latest commit information.
.github blob&file 1.3.1 version change and new recordings Jul 16, 2018
azure-storage-blob Merge pull request #476 from Azure/dev Jul 16, 2018
azure-storage-common Merge pull request #476 from Azure/dev Jul 16, 2018
azure-storage-file Merge pull request #476 from Azure/dev Jul 16, 2018
azure-storage-nspkg Version change for 1.0.0 Jan 18, 2018
azure-storage-queue Fix READMEs in each package Jun 28, 2018
doc Bumped version for 1.3.0 Jun 26, 2018
samples Polished the OAuth sample Jun 20, 2018
tests blob&file 1.3.1 version change and new recordings Jul 16, 2018
.coveragerc Added code coverage report&configuration Sep 13, 2017
.gitignore Increased version for 1.2.0rc1 May 22, 2018
.travis.yml Drop 3.3 and nightly from Travis May 23, 2018 Bumped version for 1.3.0 Jun 26, 2018 Version 1.1.0 and recordings Feb 6, 2018
LICENSE.txt Converted to MIT license Dec 18, 2017
README.rst Fixed broken link to API reference May 3, 2018
package_service_mapping.json Removed table package from the repo Oct 4, 2017
requirements.txt Added support for OAuth authentication for HTTPS requests May 22, 2018 Added tool script to clean out blob containers May 23, 2018 Fixed design flaw for get_blob_to_* and get_file_to_* methods when ma… Jul 11, 2018 Updated disclaimer for tool_reset_account Jun 1, 2018 Fix READMEs in each package Jun 28, 2018


Microsoft Azure Storage SDK for Python

This project provides a client library in Python that makes it easy to consume Microsoft Azure Storage services. For documentation please see the Microsoft Azure Python Developer Center and our API Reference (also available on readthedocs).

If you are looking for the Service Bus or Azure Management libraries, please visit


IMPORTANT: If you have an earlier version of the azure package (version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first then install it again:

pip uninstall azure
pip install azure

If you are upgrading from a version older than 0.30.0, see the upgrade doc, the usage samples in the samples directory, and the ChangeLog and BreakingChanges.

If you are encountering problems installing azure storage on Azure Web Apps, upgrading pip might help.

IMPORTANT: If you have an earlier version of the azure-storage package (version <= 0.36.0), you should uninstall it before installing the new split packages.

You can check the version using pip:

pip freeze

If you see azure-storage==0.36.0 (or any version below 0.36.0), uninstall it first:

pip uninstall azure-storage


  • Blob
    • Create/Read/Update/Delete Containers
    • Create/Read/Update/Delete Blobs
    • Advanced Blob Operations
  • Queue
    • Create/Delete Queues
    • Insert/Peek Queue Messages
    • Advanced Queue Operations
  • Files
    • Create/Update/Delete Shares
    • Create/Update/Delete Directories
    • Create/Read/Update/Delete Files
    • Advanced File Operations

Getting Started


The Azure Storage SDK for Python is composed of 5 packages:

  • azure-storage-blob
    • Contains the blob service APIs.
  • azure-storage-file
    • Contains the file service APIs.
  • azure-storage-queue
    • Contains the queue service APIs.
  • azure-storage-common
    • Contains common code shared by blob, file and queue.
  • azure-storage-nspkg
    • Owns the namespace, user should not use this directly.

Note: prior to and including version 0.36.0, there used to be a single package (azure-storage) containing all services. It is no longer supported, and users should install the 3 before-mentioned service packages individually, depending on the need. In addition, the table package is no longer releasing under the azure-storage namespace, please refer to cosmosdb.

Option 1: Via PyPi

To install via the Python Package Index (PyPI), type:

pip install azure-storage-blob
pip install azure-storage-file
pip install azure-storage-queue

Option 2: Source Via Git

To get the source code of the SDK via git just type:

git clone git://

cd ./azure-storage-python/azure-storage-nspkg
python install

cd ../azure-storage-common
python install

cd ../azure-storage-blob
python install

Replace azure-storage-blob with azure-storage-file or azure-storage-queue, to install the other services.

Option 3: Source Zip

Download a zip of the code via GitHub or PyPi. Then follow the same instructions in option 2.

Minimum Requirements

  • Python 2.7, 3.3, 3.4, 3.5, or 3.6.
  • See for dependencies


To use this SDK to call Microsoft Azure storage services, you need to first create an account.


To make debugging easier, it is recommended to turn on logging for the logger named ''. Here are two example configurations:

# Basic configuration: configure the root logger, including ''
logging.basicConfig(format='%(asctime)s %(name)-20s %(levelname)-5s %(message)s', level=logging.INFO)
# More advanced configuration allowing more control
logger = logging.getLogger('')
handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s %(name)-20s %(levelname)-5s %(message)s')

Here is how we use the logging levels, it is recommended to use INFO:

  • DEBUG: log strings to sign
  • INFO: log outgoing requests and responses, as well as retry attempts
  • WARNING: not used
  • ERROR: log calls that still failed after all the retries

Code Sample

See the samples directory for blob, queue, and file usage samples.

Need Help?

Be sure to check out the Microsoft Azure Developer Forums on MSDN or the Developer Forums on Stack Overflow if you have trouble with the provided code.

Contribute Code or Provide Feedback

If you would like to become an active contributor to this project, please follow the instructions provided in Azure Projects Contribution Guidelines. You can find more details for contributing in the doc.

If you encounter any bugs with the library, please file an issue in the Issues section of the project.

Learn More