Share via


Set Sas Definition - Set Sas Definition

Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.

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

URI Parameters

Name In Required Type Description
sas-definition-name
path True

string

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

The name of the SAS definition. 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.

storage-account-name
path True

string

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

The name of the storage account.

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
sasType True

SasTokenType

The type of SAS token the SAS definition will create.

templateUri True

string

The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template.

validityPeriod True

string

The validity period of SAS tokens created according to the SAS definition.

attributes

SasDefinitionAttributes

The attributes of the SAS definition.

tags

object

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

Responses

Name Type Description
200 OK

SasDefinitionBundle

The created SAS definition.

Other Status Codes

KeyVaultError

Key Vault error response describing why the operation failed.

Examples

Set Storage Sas definition

Sample request

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

{
  "templateUri": "se=2018-02-01T00%3A00Z&spr=https&sv=2017-04-17&sr=b&sig=XXFNfuMCHYrBx0bhemJ7PWn0xGfImMXT6LfbXWvtRUk%3D",
  "sasType": "service",
  "validityPeriod": "P15D",
  "attributes": {
    "enabled": true
  }
}

Sample response

{
  "id": "https://myvault.vault.azure.net/storage/setsas01/sas/setStrgSasDef01",
  "sid": "https://myvault.vault.azure.net/secrets/setsas01-setStrgSasDef01",
  "templateUri": "se=2018-02-01T00%3A00Z&spr=https&sv=2017-04-17&sr=b&sig=XXFNfuMCHYrBx0bhemJ7PWn0xGfImMXT6LfbXWvtRUk%3D",
  "sasType": "service",
  "validityPeriod": "P15D",
  "attributes": {
    "enabled": true,
    "created": 1490738438,
    "updated": 1490738438,
    "recoveryLevel": "Recoverable"
  }
}

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.

SasDefinitionAttributes

The SAS definition management attributes.

SasDefinitionBundle

A SAS definition bundle consists of key vault SAS definition details plus its attributes.

SasDefinitionCreateParameters

The SAS definition create parameters.

SasTokenType

The type of SAS token the SAS definition will create.

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.

Value Description
Purgeable

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+Purgeable

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

Recoverable

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

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

CustomizedRecoverable+Purgeable

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.

CustomizedRecoverable

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

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.

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.

SasDefinitionAttributes

The SAS definition management attributes.

Name Type Description
created

integer (unixtime)

Creation time in UTC.

enabled

boolean

the enabled state of the object.

recoverableDays

integer (int32)

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 SAS definitions in the current vault. If it contains 'Purgeable' the SAS definition can be permanently deleted by a privileged user; otherwise, only the system can purge the SAS definition, at the end of the retention interval.

updated

integer (unixtime)

Last updated time in UTC.

SasDefinitionBundle

A SAS definition bundle consists of key vault SAS definition details plus its attributes.

Name Type Description
attributes

SasDefinitionAttributes

The SAS definition attributes.

id

string

The SAS definition id.

sasType

SasTokenType

The type of SAS token the SAS definition will create.

sid

string

Storage account SAS definition secret id.

tags

object

Application specific metadata in the form of key-value pairs

templateUri

string

The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template.

validityPeriod

string

The validity period of SAS tokens created according to the SAS definition.

SasDefinitionCreateParameters

The SAS definition create parameters.

Name Type Description
attributes

SasDefinitionAttributes

The attributes of the SAS definition.

sasType

SasTokenType

The type of SAS token the SAS definition will create.

tags

object

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

templateUri

string

The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template.

validityPeriod

string

The validity period of SAS tokens created according to the SAS definition.

SasTokenType

The type of SAS token the SAS definition will create.

Value Description
account
service