Azure Storage libraries for Java

The Azure Storage libraries for Java provide classes for working with data in your your Azure storage account, and with the storage account itself. For more information about Azure Storage, see Introduction to Azure Storage.

Client library for data access

Use the Azure Storage client library for Java to work with data in your storage account. The following table describes the recommended versions of the storage client library for Java.

Library version Supported services Maven Reference Source, Readme, Examples
Version 12 (preview) Blob, Queue, and File Blob
Queue
File
Version 12 reference Blob
Queue
File
Version 8 Blob, Queue, File, and Table All services Version 8 reference All services

To use the client library in your project, add a dependency to your Maven pom.xml file. To learn how to add the dependency, visit the source repository listed in the table above for the client library you wish to use. For more information about adding a dependency in Java, see Add a dependency.

For more information about using the Azure Storage client library for Java, see the following articles:

Client library for resource management

Use the Azure Storage resource provider to manage storage accounts, account keys, access tiers, and more. To use the resource provider library, add a dependency to your Maven pom.xml file. The latest version of the resource provider library is available on Maven.

For more information about the resource provider library, see the Management reference. The source code for the resource provider library is available in the Azure Java SDK repository.

The following example creates a new storage account in your subscription and retrieves its access keys.

StorageAccount storageAccount = azure.storageAccounts().define(storageAccountName)
        .withRegion(Region.US_EAST)
        .withNewResourceGroup(rgName)
        .create();

// get a list of storage account keys related to the account
List<StorageAccountKey> storageAccountKeys = storageAccount.getKeys();
for(StorageAccountKey key : storageAccountKeys)    {
    System.out.println("Key name: " + key.keyName() + " with value "+ key.value());
}