Reputation: 7702
With Azure CLI one uses
az keyvault secret show
to read the secret value.
How is it done with Azure Powershell/Az.KeyVault?
I have tried GetAzKeyVaultSecret
but it returns the record without the secret value.
Upvotes: 2
Views: 20046
Reputation: 259
Get-AzKeyVaultSecret
in the Azure Az PowerShell module is the equivalent of az keyvault secret show
in the Azure CLI:
PowerShell Az Module
$keyVaultValue = Get-AzKeyVaultSecret -VaultName "kobulloc-keyvaultAZPS" -Name "ExampleAZPSPassword"
$keyVaultValue.SecretValue | ConvertFrom-SecureString -AsPlainText
CLI
az keyvault secret show --name "ExampleCLIPassword" --vault-name "kobulloc-keyvaultCLI" --query "value"
References:
Upvotes: 6