Sets up an existing Azure Storage Account with Key Vault for Storage Account keys to be managed by
Key Vault. The Storage Account must already exist. The Storage Keys are never exposed to caller.
Key Vault auto regenerates and switches the active key based on the regeneration period. See Azure Key Vault managed storage account - PowerShell for an overview of this feature.
Examples
Example 1: Set an Azure Storage Account with Key Vault to manage its keys
Id : https://myvault.vault.azure.net:443/storage/mystorageaccount
Vault Name : myvault
AccountName : mystorageaccount
Account Resource Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myrg/providers/Microsoft.St
orage/storageAccounts/mystorageaccount
Active Key Name : key1
Auto Regenerate Key : True
Regeneration Period : 90.00:00:00
Enabled : True
Created : 5/21/2018 11:55:58 PM
Updated : 5/21/2018 11:55:58 PM
Tags :
Sets a Storage Account with Key Vault for its keys to be managed by Key Vault. The active key set
is 'key1'. This key will be used to generate sas tokens. Key Vault will regenerate 'key2' key after
the regeneration period from the time of this command and set it as the active key. This auto
regeneration process will continue between 'key1' and 'key2' with a gap of 90 days.
Example 2: Set a Classic Azure Storage Account with Key Vault to manage its keys
Id : https://myvault.vault.azure.net:443/storage/mystorageaccount
Vault Name : myvault
AccountName : mystorageaccount
Account Resource Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/myvault/providers/Microsoft.Cl
assicStorage/storageAccounts/mystorageaccount
Active Key Name : Primary
Auto Regenerate Key : True
Regeneration Period : 90.00:00:00
Enabled : True
Created : 5/21/2018 11:55:58 PM
Updated : 5/21/2018 11:55:58 PM
Tags :
Sets a Classic Storage Account with Key Vault for its keys to be managed by Key Vault. The active
key set is 'Primary'. This key will be used to generate sas tokens. Key Vault will regenerate
'Secondary' key after the regeneration period from the time of this command and set it as the
active key. This auto regeneration process will continue between 'Primary' and 'Secondary' with a
gap of 90 days.
Parameters
-AccountName
Key Vault managed storage account name. Cmdlet constructs the FQDN of a managed storage account
name from vault name, currently selected environment and manged storage account name.
Auto regenerate key. If true, then the managed storage account's inactive key gets auto regenerated
and becomes the new active key after the regeneration period. If false, then the keys of managed
storage account are not auto regenerated.
Regeneration period. If auto regenerate key is enabled, this value specifies the timespan after
which managed storage account's inactive keygets auto regenerated and becomes the new active key.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.