使用 Az.KeyVault Powershell 模块从 Azure Keyvault 检索机密值

Retrieve the secret value from Azure Keyvault with Az.KeyVault Powershell module

Azure CLI一个用
az keyvault secret show
读取秘密值。

Azure Powershell/Az.KeyVault是怎么做到的?

我试过GetAzKeyVaultSecret但是它returns没有秘密值的记录。

Get-AzKeyVaultSecretAzure Az PowerShell module is the equivalent of az keyvault secret show in the Azure CLI:

PowerShell Az 模块

$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"

参考文献: