View contents of Secret in Azure KeyVault

This may seem like a very simple question, but I created KeyVault in Azure and added two Secrets to it, which are examples of the plain text "hello world" using ConvertTo-SecureString.

Using Get-AzureKeyVaultSecret, I see that these two entries are there, and also see unique URIs for each of them, however I cannot find a way to get the source text of "hello world". added to every secret.

Can anyone point out the missing link, as the current documentation on the Microsoft website is currently not too expansive.

+4
source share
1 answer

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

+7

Source: https://habr.com/ru/post/1625165/


All Articles