Restore-AzureKeyVaultManagedStorageAccount

Restores a managed storage account in a key vault from a backup file.

Important

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

Syntax

Restore-AzureKeyVaultManagedStorageAccount
       [-VaultName] <String>
       [-InputFile] <String>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzureKeyVaultManagedStorageAccount
       [-InputObject] <PSKeyVault>
       [-InputFile] <String>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzureKeyVaultManagedStorageAccount
       [-ResourceId] <String>
       [-InputFile] <String>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Restore-AzureKeyVaultManagedStorageAccount cmdlet creates a managed storage account in the specified key vault from a backup file. This managed storage account is a replica of the backed-up managed storage account in the input file and has the same name as the original. If the key vault already contains a managed storage account by the same name, this cmdlet fails instead of overwriting the original. The key vault that you restore the managed storage account into can be different from the key vault that you backed up the managed storage account from. However, the key vault must use the same subscription and be in an Azure region in the same geography (for example, North America). See the Microsoft Azure Trust Center (https://azure.microsoft.com/support/trust-center/) for the mapping of Azure regions to geographies.

Examples

Example 1: Restore a backed-up managed storage account

PS C:\> Restore-AzureKeyVaultManagedStorageAccount -VaultName 'MyKeyVault' -InputFile "C:\Backup.blob"

Id                  : https://mykeyvault.vault.azure.net:443/storage/mystorageaccount
Vault Name          : MyKeyVault
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                :

This command restores a managed storage account, including all of its versions, from the backup file named Backup.blob into the key vault named MyKeyVault.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputFile

Input file. The input file containing the backed-up blob

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

KeyVault object

Type:PSKeyVault
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceId

KeyVault Resource Id

Type:String
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-VaultName

Vault name. Cmdlet constructs the FQDN of a vault based on the name and currently selected environment.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSKeyVault

Parameters: InputObject (ByValue)

String

Outputs

PSKeyVaultManagedStorageAccount