View contents of Secret in Azure KeyVault

穿精又带淫゛_ 提交于 2019-12-07 05:19:49

问题


This may seem like a very basic question, but I've created a KeyVault in Azure and have added two Secrets to it which are plain text 'hello world' examples secured using ConvertTo-SecureString.

Using Get-AzureKeyVaultSecret I can see that the two entries are there, and also see the unique URIs for each one, however I can't seem to work out any way to actually retrieve the 'hello world' text I've added into each secret.

Can anyone provide the missing link, as the current documentation on the Microsoft site isn't too expansive at present.


回答1:


Something like this should do it...

$key = Add-AzureKeyVaultKey -VaultName DeploymentVault `
                            -Name test1 -Destination Software

$securepwd = ConvertTo-SecureString –String '123' –AsPlainText –Force

$secrets = Set-AzureKeyVaultSecret -VaultName DeploymentVault `
                                   -Name test1 `
                                   -SecretValue $securepwd

$secret = Get-AzureKeyVaultSecret -VaultName DeploymentVault -Name test1

$secret.SecretValueText

which returns 123



来源:https://stackoverflow.com/questions/34906096/view-contents-of-secret-in-azure-keyvault

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!