Last active
July 20, 2019 16:53
-
-
Save subhankars/5b41a5db8f91d62eafd20ef523de8c7c to your computer and use it in GitHub Desktop.
WebJob Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.ConfigureAppConfiguration((hostingContext, config) => | |
{ | |
var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); | |
Console.WriteLine("Environment Variable: " + environmentName); | |
var env = hostingContext.HostingEnvironment; | |
Console.WriteLine("hostingContext.HostingEnvironment: " + env.EnvironmentName); | |
config.SetBasePath(Directory.GetCurrentDirectory()) | |
.AddJsonFile($"appsettings.json", optional: true, reloadOnChange: true) | |
.AddJsonFile($"appsettings.{environmentName}.json", optional: true, reloadOnChange: true) | |
.AddEnvironmentVariables().Build(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment