Last active
July 7, 2021 13:49
-
-
Save asadrefai/bc04025928b843dfd034f40b05772461 to your computer and use it in GitHub Desktop.
Snippet for getting secret value from Azure Key Vault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string secretName = "TestName"; | |
var keyVaultName = "test-blog-kv"; | |
var kvUri = $"https://{keyVaultName}.vault.azure.net"; | |
var client = new SecretClient(new Uri(kvUri), new DefaultAzureCredential()); | |
var secret = await client.GetSecretAsync(secretName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment