title: ASP.NET Core: IConfigurationBuilder Does Not Contain Definition For AddAzureKeyVault
body: <p>I am upgrading my ASP.NET Core web app to .NET Core 2.1, but am getting the following error:</p>
  
  <blockquote>
    <p>IConfigurationBuilder Does Not Contain Definition For AddAzureKeyVault</p>
  </blockquote>
  
  <p>This code works in .NET Core 2.0. It looks like a library is missing in .NET Core 2.1.</p>
  
  <pre><code>using System;
  using Microsoft.AspNetCore;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.Azure.KeyVault;
  using Microsoft.Azure.Services.AppAuthentication;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.Configuration.AzureKeyVault;
  
  namespace MyNamesace
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              CreateWebHostBuilder(args).Build().Run();
          }
  
          public static IWebHostBuilder CreateWebHostBuilder(string[] args)
          {
              return WebHost.CreateDefaultBuilder(args)
                      .ConfigureAppConfiguration((ctx, builder) =&gt;
                      {
                          var keyVaultEndpoint = GetKeyVaultEndpoint();
                          if (!string.IsNullOrEmpty(keyVaultEndpoint))
                          {
                              var azureServiceTokenProvider = new AzureServiceTokenProvider();
                              var keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
  
                              builder.AddAzureKeyVault(keyVaultEndpoint, keyVaultClient, new DefaultKeyVaultSecretManager());
                          }
                      })
                      .UseStartup&lt;Startup&gt;();
          }
  
          static string GetKeyVaultEndpoint() =&gt; Environment.GetEnvironmentVariable("KeyVaultEndpoint");
      }
  }
  </code></pre>