public void TestMethod1() { var configurationManager = new ConfigurationManager(new AppSettingsProvider()); configurationManager.UseAzureKeyVault( new AzureKeyVaultSettingsProviderOptions { ConfigurationManager = configurationManager, SecretConverter = DecryptEnvelop }); var test = configurationManager.GetAzureKeyVaultSecret("storage"); Console.WriteLine(test.Value); }
// This method gets called by a runtime. // Use this method to add services to the container public void ConfigureServices(IServiceCollection services) { services.AddMvc(); var configurationManager = new ConfigurationManager(new AppSettingsProvider()); configurationManager.UseAzureKeyVault( new AzureKeyVaultSettingsProviderOptions { ConfigurationManager = configurationManager, SecretConverter = DecryptEnvelop }); services.AddInstance(configurationManager); // Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers. // You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json. // services.AddWebApiConventions(); }