Get started with Azure Stack Hub storage development tools

Microsoft Azure Stack Hub provides a set of storage services that includes blob, table, and queue storage.

Use this article as a guide to get started using Azure Stack Hub storage development tools. You can find more detailed information and sample code in corresponding Azure storage tutorials.

Note

There are differences between Azure Stack Hub storage and Azure storage, including specific requirements for each platform. For example, there are specific client libraries and endpoint suffix requirements for Azure Stack Hub. For more information, see Azure Stack Hub storage: Differences and considerations.

Azure client libraries

For the storage client libraries, be aware of the version that is compatible with the REST API. You must also specify the Azure Stack Hub endpoint in your code.

2008 update and newer

Client library Azure Stack Hub supported version Link Endpoint specification
.NET 12.5.0 NuGet package:
Common: https://www.nuget.org/packages/Azure.Storage.common/12.5.0
Blob: https://www.nuget.org/packages/Azure.Storage.Blobs/12.5.0
Queue: https://www.nuget.org/packages/Azure.Storage.queues/12.5.0

GitHub release:
Common: https://github.com/Azure/azure-sdk-for-net/tree/Azure.Storage.Common_12.5.0/sdk/storage
Blob: https://github.com/Azure/azure-sdk-for-net/tree/Azure.Storage.Blobs_12.5.0/sdk/storage
Queue: https://github.com/Azure/azure-sdk-for-net/tree/Azure.Storage.Queues_12.5.0/sdk/storage
app.config file
Java 12.7.0 Maven package:
https://mvnrepository.com/artifact/com.azure/azure-storage-common/12.7.0

GitHub release:
https://github.com/Azure/azure-sdk-for-java/tree/azure-storage-common_12.7.0/sdk/storage
Connection string setup
Node.js 2.8.3 NPM link:
https://www.npmjs.com/package/azure-storage
(Run: npm install azure-storage@2.8.3)

GitHub release:
https://github.com/Azure/azure-storage-node/releases/tag/v2.8.3
Service instance declaration
C++ 7.2.0 GitHub release:
https://github.com/Azure/azure-storage-cpp/releases/tag/v7.2.0
Connection string setup
PHP 1.2.0 GitHub release:
Common: https://github.com/Azure/azure-storage-php/releases/tag/v1.2.0-common
Blob: https://github.com/Azure/azure-storage-php/releases/tag/v1.2.0-blob
Queue:
https://github.com/Azure/azure-storage-php/releases/tag/v1.1.1-queue
Table: https://github.com/Azure/azure-storage-php/releases/tag/v1.1.0-table

Install via Composer (To learn more, see the details below.)
Connection string setup
Python 12.3.2 GitHub release:
Blob:
https://github.com/Azure/azure-sdk-for-python/tree/azure-storage-blob_12.3.2/sdk/storage/azure-storage-blob
Queue:
https://github.com/Azure/azure-sdk-for-python/tree/azure-storage-blob_12.3.2/sdk/storage/azure-storage-queue
Service instance declaration
Ruby 1.0.1 RubyGems package:
Common:
https://rubygems.org/gems/azure-storage-common/versions/1.0.1
Blob: https://rubygems.org/gems/azure-storage-blob/versions/1.0.1
Queue: https://rubygems.org/gems/azure-storage-queue/versions/1.0.1
Table: https://rubygems.org/gems/azure-storage-table/versions/1.0.1

GitHub release:
Common: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-common
Blob: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-blob
Queue: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-queue
Table: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-table
Connection string setup

Install PHP client via Composer - current

To install via Composer: (take the blob as an example).

  1. Create a file named composer.json in the root of the project with following code:

    {
      "require": {
      "Microsoft/azure-storage-blob":"1.2.0"
      }
    }
    
  2. Download composer.phar to the project root.

  3. Run: php composer.phar install.

2005 update

Client library Azure Stack Hub supported version Link Endpoint specification
.NET 11.0.0 NuGet package:
Common: https://www.nuget.org/packages/Microsoft.Azure.Storage.Common/11.0.0
Blob: https://www.nuget.org/packages/Microsoft.Azure.Storage.Blob/11.0.0
Queue:
https://www.nuget.org/packages/Microsoft.Azure.Storage.Queue/11.0.0

GitHub release:
https://github.com/Azure/azure-storage-net/releases/tag/v11.0.0
app.config file
Java 12.0.0-preview.3 Maven package:
https://mvnrepository.com/artifact/com.azure/azure-storage-blob/12.0.0-preview.3

GitHub release:
https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/storage
Connection string setup
Node.js 2.8.3 NPM link:
https://www.npmjs.com/package/azure-storage
(Run: npm install azure-storage@2.8.3)

GitHub release:
https://github.com/Azure/azure-storage-node/releases/tag/v2.8.3
Service instance declaration
C++ 7.1.0 GitHub release:
https://github.com/Azure/azure-storage-cpp/releases/tag/v7.1.0
Connection string setup
PHP 1.2.0 GitHub release:
Common: https://github.com/Azure/azure-storage-php/releases/tag/v1.2.0-common
Blob: https://github.com/Azure/azure-storage-php/releases/tag/v1.2.0-blob
Queue:
https://github.com/Azure/azure-storage-php/releases/tag/v1.1.1-queue
Table: https://github.com/Azure/azure-storage-php/releases/tag/v1.1.0-table

Install via Composer (To learn more, see the details below.)
Connection string setup
Python 2.1.0 GitHub release:
Common:
https://github.com/Azure/azure-storage-python/releases/tag/v2.1.0-common
Blob:
https://github.com/Azure/azure-storage-python/releases/tag/v2.1.0-blob
Queue:
https://github.com/Azure/azure-storage-python/releases/tag/v2.1.0-queue
Service instance declaration
Ruby 1.0.1 RubyGems package:
Common:
https://rubygems.org/gems/azure-storage-common/versions/1.0.1
Blob: https://rubygems.org/gems/azure-storage-blob/versions/1.0.1
Queue: https://rubygems.org/gems/azure-storage-queue/versions/1.0.1
Table: https://rubygems.org/gems/azure-storage-table/versions/1.0.1

GitHub release:
Common: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-common
Blob: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-blob
Queue: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-queue
Table: https://github.com/Azure/azure-storage-ruby/releases/tag/v1.0.1-table
Connection string setup

Install PHP client via Composer - current

To install via Composer: (take the blob as an example).

  1. Create a file named composer.json in the root of the project with following code:

    {
      "require": {
      "Microsoft/azure-storage-blob":"1.2.0"
      }
    }
    
  2. Download composer.phar to the project root.

  3. Run: php composer.phar install.

Endpoint declaration

An Azure Stack Hub endpoint includes two parts: the name of a region and the Azure Stack Hub domain. In the Azure Stack Development Kit, the default endpoint is local.azurestack.external. Contact your cloud admin if you're not sure about your endpoint.

Examples

.NET

For Azure Stack Hub, the endpoint suffix is specified in the app.config file:

<add key="StorageConnectionString"
value="DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;
EndpointSuffix=local.azurestack.external;" />

Java

For Azure Stack Hub, the endpoint suffix is specified in the setup of connection string:

public static final String storageConnectionString =
    "DefaultEndpointsProtocol=http;" +
    "AccountName=your_storage_account;" +
    "AccountKey=your_storage_account_key;" +
    "EndpointSuffix=local.azurestack.external";

Node.js

For Azure Stack Hub, the endpoint suffix is specified in the declaration instance:

var blobSvc = azure.createBlobService('myaccount', 'mykey',
'myaccount.blob.local.azurestack.external');

C++

For Azure Stack Hub, the endpoint suffix is specified in the setup of connection string:

const utility::string_t storage_connection_string(U("DefaultEndpointsProtocol=https;
AccountName=your_storage_account;
AccountKey=your_storage_account_key;
EndpointSuffix=local.azurestack.external"));

PHP

For Azure Stack Hub, the endpoint suffix is specified in the setup of connection string:

$connectionString = 'BlobEndpoint=https://<storage account name>.blob.local.azurestack.external/;
QueueEndpoint=https:// <storage account name>.queue.local.azurestack.external/;
TableEndpoint=https:// <storage account name>.table.local.azurestack.external/;
AccountName=<storage account name>;AccountKey=<storage account key>'

Python

For Azure Stack Hub, the endpoint suffix is specified in the declaration instance:

block_blob_service = BlockBlobService(account_name='myaccount',
account_key='mykey',
endpoint_suffix='local.azurestack.external')

Ruby

For Azure Stack Hub, the endpoint suffix is specified in the setup of connection string:

set
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;
AccountName=myaccount;
AccountKey=mykey;
EndpointSuffix=local.azurestack.external

Blob storage

The following Azure Blob storage tutorials are applicable to Azure Stack Hub. Note the specific endpoint suffix requirement for Azure Stack Hub described in the previous Examples section.

Queue storage

The following Azure Queue storage tutorials are applicable to Azure Stack Hub. Note the specific endpoint suffix requirement for Azure Stack Hub described in the previous Examples section.

Table storage

The following Azure Table storage tutorials are applicable to Azure Stack Hub. Note the specific endpoint suffix requirement for Azure Stack Hub described in the previous Examples section.

Next steps