Update-AzKeyVault

Update the state of an Azure key vault.

Syntax

Update-AzKeyVault
      -ResourceGroupName <String>
      -VaultName <String>
      [-EnablePurgeProtection]
      [-EnableRbacAuthorization <Boolean>]
      [-Tag <Hashtable>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzKeyVault
      -InputObject <PSKeyVault>
      [-EnablePurgeProtection]
      [-EnableRbacAuthorization <Boolean>]
      [-Tag <Hashtable>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzKeyVault
      -ResourceId <String>
      [-EnablePurgeProtection]
      [-EnableRbacAuthorization <Boolean>]
      [-Tag <Hashtable>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

This cmdlet updates the state of an Azure key vault.

Examples

Example 1: Enable purge protection

PS C:\> Get-AzKeyVault -VaultName $keyVaultName -ResourceGroupName $resourceGroupName | Update-AzKeyVault -EnablePurgeProtection

Enables purge protection using piping syntax.

Example 2: Enable RBAC Authorization

PS C:\> Get-AzKeyVault -VaultName $keyVaultName -ResourceGroupName $resourceGroupName | Update-AzKeyVault -EnableRbacAuthorization $true

Enables RBAC Authorization using piping syntax.

Example 3: Set tags

PS C:\> Get-AzKeyVault -VaultName $keyVaultName | Update-AzKeyVault -Tags @{key = "value"}

Sets the tags of a key vault named $keyVaultName.

Example 4: Clean tags

PS C:\> Get-AzKeyVault -VaultName $keyVaultName | Update-AzKeyVault -Tags @{}

Deletes all tags of a key vault named $keyVaultName.

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.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnablePurgeProtection

Enable the purge protection functionality for this key vault. Once enabled it cannot be disabled. It requires soft-delete to be turned on.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableRbacAuthorization

Enable or disable this key vault to authorize data actions by Role Based Access Control (RBAC).

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Key vault object.

Type:PSKeyVault
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceGroupName

Name of the resource group.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceId

Resource ID of the key vault.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Tag

A hash table which represents resource tags.

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-VaultName

Name of the key vault.

Type:String
Aliases:Name
Position:Named
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

String

Outputs

PSKeyVault