I am struggling to find documentation for this.. Here's what I have:
- I have a working keyvault
- I am not entirely sure I am using the correct terms, but I want to use the account logged in VS to access the KV. I think that may be called DefaultAzureCredentials.
- I've done this before in various dev environments - but it was always been through existing infrastructure. I am working with the basic azure libraries
- What I am used to, is the ability to define the KV URL as an env-var and then tell the secret provider what keys it needs to populate (this is another configuration provider).
- Not sure if needed or not, but I added the KV as a connected service to my csproj
- My asp.net project was created automatically for 7.0 and does not use the < Start > mechanism, instead it's creating a
WebApplication.CreateBuilder()
.
I am not entirely sure what comes "out of the box" and what needs to be coded.
I have found this: Use keyvault
However, it seems to suggest using a local keyvault. And I could not find ways of doing this in WebApplication.CreateBuilder()
. It seems like if I could get an IConfigurationBuilder
, I'd be able to use some of the extension methods found in Azure.Extensions.AspNetCore.Configuration.Secrets
to connect, but I can't even figure out how to get that in .net7.