QuestionQ141

VerifiedConnect to and consume Azure services and third-party services

You are developing an Azure solution.

You need to write code that accesses a secret stored in Azure Key Vault.

Each code segment can be used once, more than once, or not at all.

Drag & Drop
string var1 = Environment.GetEnvironmentVariable("KEY_VAULT_URI");

var var2 = new  ( new Uri(var1), new  ());
Explanation

SecretClient is the Azure Key Vault Secrets SDK client. Its constructor takes the vault URI and a TokenCredential; DefaultAzureCredential provides that credential and selects an available development or Azure-hosted identity at runtime.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!