Is there any way to get the value of a secret from Azure Key Vault?
Doesn't look like value
gets exposed in the key vault secret object here.
If you click on the current version, you can see the value you specified in the previous step. By clicking "Show Secret Value" button in the right pane, you can see the hidden value. You can also use Azure CLI, or Azure PowerShell to retrieve previously created secret.
Inside the keyvault folder, create the variables.tf file to store variables used by the module: Then, create the main.tf to create the Azure Key Vault and policies, inside the keyvault folder: Finally, we create the ouput.tf file in the same folder used to return the values of the Terraform module.
Now you can do it with azurerm_key_vault_secret data source.
I'm enjoying without any scripting.
data "azurerm_key_vault_secret" "test" {
name = "secret-sauce"
vault_uri = "https://rickslab.vault.azure.net/"
}
output "secret_value" {
value = "${data.azurerm_key_vault_secret.test.value}"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With