Set Storage Account - Set Storage Account

Creates or updates a new storage account. This operation requires the storage/set permission.

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

URI Parameters

Name In Required Type Description
storage-account-name
path True

string

The name of the storage account. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.

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

vaultBaseUrl
path True

string

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

api-version
query True

string

Client API version.

Request Body

Name Required Type Description
activeKeyName True

string

Current active storage account key name.

autoRegenerateKey True

boolean

whether keyvault should manage the storage account for the user.

resourceId True

string

Storage account resource id.

attributes

StorageAccountAttributes

The attributes of the storage account.

regenerationPeriod

string

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

tags

object

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

Responses

Name Type Description
200 OK

StorageBundle

The created storage account.

Other Status Codes

KeyVaultError

Key Vault error response describing why the operation failed.

Examples

Set Storage account

Sample Request

PUT https://myvault.vault.azure.net//storage/setStrg01?api-version=7.4

{
  "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://myvault.vault.azure.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,
    "recoveryLevel": "Recoverable+Purgeable"
  },
  "tags": {
    "tag1": "val1",
    "tag2": "val2"
  }
}

Definitions

Name Description
DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval.

Error

The key vault server error.

KeyVaultError

The key vault error exception.

StorageAccountAttributes

The storage account management attributes.

StorageAccountCreateParameters

The storage account create parameters.

StorageBundle

A Storage account bundle consists of key vault storage account details plus its attributes.

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval.

Name Type Description
CustomizedRecoverable

string

Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available.

CustomizedRecoverable+ProtectedSubscription

string

Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled.

CustomizedRecoverable+Purgeable

string

Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled.

Purgeable

string

Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.)

Recoverable

string

Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered

Recoverable+ProtectedSubscription

string

Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered

Recoverable+Purgeable

string

Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered

Error

The key vault server error.

Name Type Description
code

string

The error code.

innererror

Error

The key vault server error.

message

string

The error message.

KeyVaultError

The key vault error exception.

Name Type Description
error

Error

The key vault server error.

StorageAccountAttributes

The storage account management attributes.

Name Type Description
created

integer

Creation time in UTC.

enabled

boolean

the enabled state of the object.

recoverableDays

integer

softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0.

recoveryLevel

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval.

updated

integer

Last updated time in UTC.

StorageAccountCreateParameters

The storage account create parameters.

Name Type Description
activeKeyName

string

Current active storage account key name.

attributes

StorageAccountAttributes

The attributes of the storage account.

autoRegenerateKey

boolean

whether keyvault should manage the storage account for the user.

regenerationPeriod

string

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

resourceId

string

Storage account resource id.

tags

object

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

StorageBundle

A Storage account bundle consists of key vault storage account details plus its attributes.

Name Type Description
activeKeyName

string

The current active storage account key name.

attributes

StorageAccountAttributes

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

object

Application specific metadata in the form of key-value pairs