Created
February 28, 2019 09:07
-
-
Save shibayan/cdd6e19b9296c22527bc3c0dc9267e1d to your computer and use it in GitHub Desktop.
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
using System; | |
using Microsoft.AspNetCore; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration.AzureAppConfiguration; | |
namespace WebApplication4 | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateWebHostBuilder(args).Build().Run(); | |
} | |
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.ConfigureAppConfiguration((hostingContext, config) => | |
{ | |
var settings = config.Build(); | |
config.AddAzureAppConfiguration(options => | |
{ | |
options.ConnectionString = settings["ConnectionStrings:AppConfig"]; | |
// apply configuration for specific region | |
options.Use("*", Environment.GetEnvironmentVariable("REGION_NAME") ?? "Japan East"); | |
}); | |
}) | |
.UseStartup<Startup>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment