• <1 minute

Azure Storage SDKs for Python, Ruby and PHP now generally available

Today we are excited to announce the general availability of the Azure Storage SDKs for Python, Ruby and PHP! Thanks to everyone who participated in the previews and provided feedback.

Today we are excited to announce the general availability of the Azure Storage SDKs for Python, Ruby and PHP! Thanks to everyone who participated in the previews and provided feedback.

This GA release brings forward a few significant changes:

  • We have split the Storage SDKs into four packages, one each for Blob, Table, Queue, and File. As announced, this was done in order to reduce the footprint of the libraries and allow developers to consume only the packages they are interested in. 
  • Support is now available for newer Azure Storage REST API versions and service features. See below for details on each SDK.

Azure Storage SDK for Python

Storage SDK packages for Blob, File, and Queue in Python are available on PyPi with version 1.0. This release supports the April 4, 2017 REST API version, bringing support for archival storage and blob tiering. Table package is released under the name Azure-Cosmosdb-table.

Here is a Hello World sample with the Storage SDK for Python:

from azure.storage.blob import BlockBlobService
import os

# Create a blob service client
block_blob_service = BlockBlobService(os.environ.get('AZURE_STORAGE_ACCOUNT_NAME'), os.environ.get('AZURE_STORAGE_ACCOUNT_KEY'))

# upload a blob from text
block_blob_service.create_blob_from_text(
    'mycontainer',
    'myblockblob',
    'Hello World!'
)

# download a blob into a buffer
blob = block_blob_service.get_blob_to_bytes('mycontainer', 'myblockblob')
print blob.content

If you'd like to learn more about the Storage SDK for Python, check out our Source Code and Samples or our API Reference.

Azure Storage SDK for PHP

Storage SDK packages for Blob, Table, File, and Queue in PHP are available on Packagist.org with version 1.0. This release brings support for the May 31, 2016 REST API version, bringing service features such as larger block blobs. We are actively working on support for the latest REST API version and newer service features.

Here is a Hello World sample with the Storage SDK for PHP:

require_once 'vendor/autoload.php';

use MicrosoftAzureStorageBlobBlobRestProxy;

// Create queue REST proxy.
$blobClient = BlobRestProxy::createBlobService(getenv('AZURE_STORAGE_CONN_STRING'));

// Uploading a blob from text
$blobClient->createBlockBlob(
    'mycontainer',
    'myblockblob',
    'Hello world'
);

// Downloading a blob
$getBlobResult = $blobClient->getBlob('mycontainer', 'myblockblob');
echo stream_get_contents($getBlobResult->getContentStream());

If you'd like to learn more about the Storage SDK for PHP, check out our Source Code and Samples or our API Reference.

Azure Storage SDK for Ruby

Storage Ruby client library is now available with four split Rubygem packages with version 1.0.1: Blob, File, Table, and Queue libraries. This release brings support for the May 31, 2016 REST API version. We’ll add support for the new versions in the upcoming releases.

Here is a Hello World sample with the Storage SDK for Ruby:

require 'azure/storage/blob'
blob_client = Azure::Storage::Blob::BlobService.create(storage_account_name: 'your account name', storage_access_key: 'your access key')

// Uploading a blob from text
blob_client.create_block_blob('mycontainer', 'myblockblob', 'Hello World!')

// Downloading a blob
blob, content = client.get_blob('mycontainer', 'myblockblob')
puts content

If you'd like to learn more about the Storage SDK for Ruby, check out our Source Code and Samples or our API Reference.

Feedback

We will continue to enhance these libraries with support for new service capabilities and incorporate your feedback. Please drop us a line in the comments below if you have feedback on any of the Storage SDKs. Alternatively, feel free to raise an issue on our GitHub source code repositories.