Base solution for your next web application
Open Closed

Reading secrets from Azure Key Vault #11768


User avatar
0
elecosoftseservice created

I'm using ASP.NET Zero 11.0.1 with an Angular front-end.

I've seen this documentation on adding Azure Key Vault to the configuration: https://docs.aspnetzero.com/en/aspnet-core-angular/v11.0.0/Features-Angular-Azure-Key-Vault

...but I can't find any documentation on how to get Secrets from the vault in my application code. Can you provide an example please?


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    After configuring Azure Key-Vault, you can access configuration just like you access a regular configuration for appsettings.json. You can use IAppConfigurationAccessor and access a config like this _configurationAccessor.Configuration["ConfigurationName"]

  • User Avatar
    0
    elecosoftseservice created

    I'm pleased to report that this works perfectly. Many thanks.