Set Storage Account

Creates or updates a new storage account.

PUT https://{vaultBaseUrl}/storage/{storage-account-name}?api-version={api-version}

URI Parameters

Name In Required Type Description
vaultBaseUrl
path True
  • string

The vault name, for example https://myvault.vault.azure.net.

storage-account-name
path True
  • string

The name of the storage account.

Regex pattern: ^[0-9a-zA-Z]+$

api-version
query True
  • string

Client API version.

Request Body

Name Required Type Description
activeKeyName True
  • string

Current active storage account key name.

attributes

The attributes of the storage account.

autoRegenerateKey True
  • boolean

whether keyvault should manage the storage account for the user.

regenerationPeriod
  • string

The key regeneration time duration specified in ISO-8601 format.

resourceId True
  • string

Storage account resource id.

tags
  • <string, string>

Application specific metadata in the form of key-value pairs.

Responses

Name Type Description
200 OK

The created storage account.

Other Status Codes

Key Vault error response describing why the operation failed.

Examples

Set Storage account

Sample Request

PUT https://{vaultBaseUrl}/storage/setStrg01?api-version=2016-10-01
{
  "resourceId": "/subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Storage/storageAccounts/kvstorageacc",
  "activeKeyName": "key2",
  "autoRegenerateKey": true,
  "regenerationPeriod": "P15D",
  "attributes": {
    "enabled": true
  },
  "tags": {
    "tag1": "val1",
    "tag2": "val2"
  }
}

Sample Response

{
  "id": "https://storage-sdk-test.vault-int.azure-int.net/storage/setStrg01",
  "resourceId": "/subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Storage/storageAccounts/kvstorageacc",
  "activeKeyName": "key2",
  "autoRegenerateKey": true,
  "regenerationPeriod": "P15D",
  "attributes": {
    "enabled": true,
    "created": 1490738386,
    "updated": 1490738386
  },
  "tags": {
    "tag1": "val1",
    "tag2": "val2"
  }
}

Definitions

Error

The key vault server error.

KeyVaultError
StorageAccountAttributes

The attributes of the storage account.

StorageBundle

The key vault server error.

Name Type Description
code
  • string

The error code.

innererror
message
  • string

The error message.

Name Type Description
error

The key vault server error.

The attributes of the storage account.

Name Type Description
created
  • integer
    unixtime

Creation time in UTC.

enabled
  • boolean

the enabled state of the object.

updated
  • integer
    unixtime

Last updated time in UTC.

Name Type Description
activeKeyName
  • string

The current active storage account key name.

attributes

The storage account attributes.

autoRegenerateKey
  • boolean

whether keyvault should manage the storage account for the user.

id
  • string

The storage account id.

regenerationPeriod
  • string

The key regeneration time duration specified in ISO-8601 format.

resourceId
  • string

The storage account resource id.

tags
  • <string, string>

Application specific metadata in the form of key-value pairs