在Azure KeyVault中查看Secret的内容 [英] View contents of Secret in Azure KeyVault

查看:285
本文介绍了在Azure KeyVault中查看Secret的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个非常基本的问题,但是我在Azure中创建了KeyVault,并向其中添加了两个秘密,它们是使用ConvertTo-SecureString保护的纯文本"hello world"示例.

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.

使用Get-AzureKeyVaultSecret我可以看到其中有两个条目,还可以看到每个条目的唯一URI,但是我似乎无法找到任何方法来实际检索我已经拥有的"hello world"文本添加到每个秘密中.

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.

任何人都可以提供缺少的链接,因为Microsoft网站上的当前文档目前还不太广泛.

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

推荐答案

这样的事情应该可以解决...

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

返回123

这篇关于在Azure KeyVault中查看Secret的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆