Azure-docs: Other ways to access the Key Vault using Connected Services

Created on 17 Feb 2020  Â·  2Comments  Â·  Source: MicrosoftDocs/azure-docs

About a year ago, I'm pretty sure I followed this guide to access my Key Vault using connected Services.
I'm using ASP.NET Core 2.2 and my code still access & use key vault's secrets but...
I have only configured "Connected services" from solution explorer. In addition, I also installed other Nuget dependencies:

  • Microsoft.AspNetCore.AzureKeyVault.HostingStartup
  • Microsoft.Extensions.Configuration.AzureKeyVault
    but... I haven't done on code what is now described here at "Access your secrets in code (ASP.NET Core)"
    Even though, whenever I want to access the Key Vault secrets from within a class.
    Let's say: public MyClasss (IConfiguration configuration)
    the configuration value is populated with the values coming from the Azure Key Vault
    as my configuration has this provider: Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.
    So, my questions are:
    Is there any other way to get the values from the Key Vault, as I've just described?
    Is this "Access your secrets in code (ASP.NET Core)" the unique way or the standard way to get it?
    Could it be that some alternatives ways to get access to the Key Vault are missing from this documentation?

I believe I'm using "Managed Identities" but I haven't any code on my _Program.cs_ that calls to _AzureServiceTokenProvider_


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author key-vaulsvc product-question triaged

All 2 comments

@sebainones Thanks for your comment! We will review and provide an update as appropriate.

@sebainones I updated tutorial to better reflect current state. In general Microsoft.AspNetCore.AzureKeyVault.HostingStartup behind the scenes is using AppAuthentication library(listed as dependencies) which will use managed identity if available and try user principle if not.
With new SDK we moved to DefaultAzureCredential which is working similar, but also available for other languages and that is new recommend way https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Identity/1.1.1/api/index.html #please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DeepPuddles picture DeepPuddles  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments