<p>we successfully configured the <a href="https://learn.microsoft.com/en-us/azure/key-vault/general/key-vault-integrate-kubernetes" rel="nofollow noreferrer">CSI Driver for Azure Kubernetes Services</a>.  This allows us to pull in secrets from Azure Key Vault as &quot;files&quot; in our Pods (in our AKS Kubernetes cluster).  The <strong>name</strong> of the file is the name of the secret.  The <strong>contents</strong> of the file is the value of the secret.  I can of course read these files to get the secrets.  But I am wondering if there is some kind of IConfigurationProvider/IConfigurationSource.... already implemented that allows me to access these secrets using the standard .Net core IConfiguration object. That would allow me to do something like :</p>
<pre><code>builder.AddSecretsFromCSI(someRootPathForTheFiles);
</code></pre>
<p>in the program.cs file.  Just avoiding that I have to write this myself.  (I don't want to use the keyvault provider inside my .net core code to avoid that dependency inside my code - files work everywhere)</p>

Willy Van den Driessche
<p>It turns out .Net core has exactly what is needed for this (although a little underdocumented IMHO) :</p>
<pre><code>config.AddKeyPerFile(&quot;/app/secrets&quot;, optional: true);
                
</code></pre>
<p>(see also : <a href="https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration-providers#key-per-file-configuration-provider" rel="noreferrer">https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration-providers#key-per-file-configuration-provider</a>)</p>
