Mid
From PDF
Azure
Microsoft Azure
How do you access secrets from ASP.NET Core?
Short answer: Use Azure.Extensions.AspNetCore.Configuration.Secrets package to load secrets into IConfiguration. var builder = new ConfigurationBuilder() .AddAzureKeyVault(new Uri(" new DefaultAzureCredential()); var configuration = builder.Build();
Example code
var secretValue = configuration["MySecret"];
Real-world example (ShopNest)
Connection strings and payment keys live in Key Vault—not in source control or plain appsettings on disk.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png