Get Storage Account Keys

 

The Get Storage Keys operation returns the primary and secondary access keys for the specified storage account.

Request

The Get Storage Keys request may be specified as follows. Replace <subscription-id> with your subscription ID, and <service-name> with the name of the storage account.

Method

Request URI

GET

https://management.core.windows.net/<subscription-id>/services/storageservices/<service-name>/keys

URI Parameters

None.

Request Headers

The following table describes the request headers.

Request Header

Description

x-ms-version

Required. Specifies the version of the operation to use for this request. This header should be set to 2009-10-01 or higher.

Request Body

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

A successful operation returns status code 200 (OK).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers.

Response Header

Description

x-ms-request-id

A value that uniquely identifies a request made against the management service.

Response Body

<?xml version="1.0" encoding="utf-8"?>
  <StorageService xmlns="http://schemas.microsoft.com/windowsazure">
    <Url>storage-service-url</Url>
    <StorageServiceKeys>
      <Primary>primary-key</Primary>
      <Secondary>secondary-key</Secondary>
    </StorageServiceKeys>
  </StorageService>

The following table describes the elements of the response body.

Element name

Description

Url

The Service Management API request URI used to perform Get Storage Account Properties requests against the storage account.

Primary

The primary access key for the storage account.

Secondary

The secondary access key for the storage account.

Remarks

Use the storage keys returned from the Get Storage Account Keys operation to access the blob, queue, and table service endpoints for the storage.