< Back
Remove-AzureKeyVaultSecret
Post
NAME Remove-AzureKeyVaultSecret
SYNOPSIS
Deletes a secret in a key vault.
SYNTAX
Remove-AzureKeyVaultSecret [-InputObject] <PSKeyVaultSecretIdentityItem> [-DefaultProfile <IAzureContextContainer>] [-Force] [-InRemovedState]
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-AzureKeyVaultSecret [-VaultName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-Force] [-InRemovedState]
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Remove-AzureKeyVaultSecret cmdlet deletes a secret in a key vault. If the secret was accidentally deleted the secret can be recovered using
Undo-AzureKeyVaultSecretRemoval by a user with special 'recover' permissions. This cmdlet has a value of high for the ConfirmImpact property.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Force [<SwitchParameter>]
Forces the command to run without asking for user confirmation.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InputObject <PSKeyVaultSecretIdentityItem>
Key Vault Secret Object
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-InRemovedState [<SwitchParameter>]
If present, removes the previously deleted secret permanently.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Name <String>
Specifies the name of a secret. This cmdlet constructs the fully qualified domain name (FQDN) of a secret based on the name that this
parameter specifies, the name of the key vault, and your current environment.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Indicates that this cmdlet returns a Microsoft.Azure.Commands.KeyVault.Models.Secret object. By default, this cmdlet does not generate any
output.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-VaultName <String>
Specifies the name of the key vault to which the secret belongs. This cmdlet constructs the FQDN of a key vault based on the name that this
parameter specifies and your current environment.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
OUTPUTS
Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret
This cmdlet returns a value only if you specify the PassThru parameter.
NOTES
Example 1: Remove a secret from a key vault
PS C:\\>Remove-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'FinanceSecret'
This command removes the secret named FinanceSecret from the key vault named Contoso.'
Example 2: Remove a secret from a key vault without user confirmation
PS C:\\>Remove-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'FinanceSecret' -Force -Confirm:$False
This command removes the secret named FinanceSecret from the key vault named Contoso. The command specifies the Force and Confirm parameters, and,
therefore, the cmdlet does not prompt you for confirmation.
Example 3: Purge deleted secret from the key vault permanently
PS C:\\>Remove-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'FinanceSecret' -InRemovedState
This command premoves the secret named FinanceSecret from the key vault named Contoso permanently. Executing this cmdlet requires the 'purge'
permission, which must have been previously and explicitly granted to the user for this key vault.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... aultsecret
Get-AzureKeyVaultSecret
Set-AzureKeyVaultSecret
Undo-AzureKeyVaultSecretRemoval
SYNOPSIS
Deletes a secret in a key vault.
SYNTAX
Remove-AzureKeyVaultSecret [-InputObject] <PSKeyVaultSecretIdentityItem> [-DefaultProfile <IAzureContextContainer>] [-Force] [-InRemovedState]
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-AzureKeyVaultSecret [-VaultName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-Force] [-InRemovedState]
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Remove-AzureKeyVaultSecret cmdlet deletes a secret in a key vault. If the secret was accidentally deleted the secret can be recovered using
Undo-AzureKeyVaultSecretRemoval by a user with special 'recover' permissions. This cmdlet has a value of high for the ConfirmImpact property.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Force [<SwitchParameter>]
Forces the command to run without asking for user confirmation.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InputObject <PSKeyVaultSecretIdentityItem>
Key Vault Secret Object
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-InRemovedState [<SwitchParameter>]
If present, removes the previously deleted secret permanently.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Name <String>
Specifies the name of a secret. This cmdlet constructs the fully qualified domain name (FQDN) of a secret based on the name that this
parameter specifies, the name of the key vault, and your current environment.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Indicates that this cmdlet returns a Microsoft.Azure.Commands.KeyVault.Models.Secret object. By default, this cmdlet does not generate any
output.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-VaultName <String>
Specifies the name of the key vault to which the secret belongs. This cmdlet constructs the FQDN of a key vault based on the name that this
parameter specifies and your current environment.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
String
OUTPUTS
Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultSecret
This cmdlet returns a value only if you specify the PassThru parameter.
NOTES
Example 1: Remove a secret from a key vault
PS C:\\>Remove-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'FinanceSecret'
This command removes the secret named FinanceSecret from the key vault named Contoso.'
Example 2: Remove a secret from a key vault without user confirmation
PS C:\\>Remove-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'FinanceSecret' -Force -Confirm:$False
This command removes the secret named FinanceSecret from the key vault named Contoso. The command specifies the Force and Confirm parameters, and,
therefore, the cmdlet does not prompt you for confirmation.
Example 3: Purge deleted secret from the key vault permanently
PS C:\\>Remove-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'FinanceSecret' -InRemovedState
This command premoves the secret named FinanceSecret from the key vault named Contoso permanently. Executing this cmdlet requires the 'purge'
permission, which must have been previously and explicitly granted to the user for this key vault.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... aultsecret
Get-AzureKeyVaultSecret
Set-AzureKeyVaultSecret
Undo-AzureKeyVaultSecretRemoval