title: Combine Azure Key Vault with Azure App Configuration
body: <p>I am pretty new to Azure and I am trying to simulate a real production environment.
  So, I've deployed a .netcore 3.1 app to an AppService resource. This web app is able to get the configuration from two other services - KeyVault and App Configuration. I already have configuraed the AppService identity.</p>
  
  <ol>
  <li><p>I can get the keys from KeyVault using the following code:</p>
  
  <pre><code>var settings = config.Build();
  var web = settings["KeyVault:Name"];
  var clientId = settings["KeyVault:ClientId"];
  var clientSecret = settings["KeyVault:ClientSecret"];
  
  config.AddAzureKeyVault($"https://{web}.vault.azure.net/",
                          clientId,
                          clientSecret);
  </code></pre></li>
  <li><p>As I can get the keys from the App Configuration:</p>
  
  <pre><code>var settings = config.Build();
  config.AddAzureAppConfiguration(settings["AppSettings:Endpoint"]);
  </code></pre></li>
  <li><p>And I am able to use them both at the same time through identities and AppConfiguration's key reference</p>
  
  <pre><code>var settings = config.Build();
  config.AddAzureAppConfiguration(options =&gt;
  {
      options
     .Connect(settings["AppSettings:Endpoint"])
     .ConfigureKeyVault(kv =&gt;
     {
         kv.SetCredential(new DefaultAzureCredential());
     });
  });
  </code></pre></li>
  </ol>
  
  <p>So, my question is about the code snippet #3: is it safe to store the <code>AppSettings:Endpoint</code> value the <code>appconfig.json</code> in a production environment? To be clear, I am referring to this value:</p>
  
  <p><a href="https://i.stack.imgur.com/pDpGK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pDpGK.png" alt="enter image description here"></a></p>
  
  <p>Moreover, I found <a href="https://kasunkodagoda.com/2020/02/04/centralized-configuration-management-using-azure-app-configuration-using-azure-key-vault-side-by-side/" rel="nofollow noreferrer">here</a> and explanation on how to use the two services together. But first of all, that solution doesn't work for me - I get an <code>Azure.Identity.CredentialUnavailableException: 'ManagedIdentityCredential authentication unavailable, no managed identity endpoint found.'</code>.
  On the second hand, he's not clear on where to store the <code>AppSettings:AppConfiguration:Endpoint</code> and <code>AppSettings:Identity:ClientId</code> values, it doesn't answer to my first question then.</p>
  
  <p>Thanks in advance</p>