メモ
public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseApplicationInsights() .UseStartup<Startup>() .Build();
Configuration.GetConnectionString("DB");
appsettings.json
{ "ApplicationInsights": { "InstrumentationKey": "xxxxxxxxxxxxxxxx" }, "ConnectionStrings": { "DB": "xxxxxxxxxxxxxxxxxxxxx" } }
って書いてるときの、App Service の Application Settings は、
- Application settings
- ApplicationInsights__InstrumentationKey
- Connection strings
- DB
でOK。
Connection strings は、環境変数に prefix 付くけど 「Configuration.GetConnectionString("DB");」で問題なく取れるらしい。
Working with Azure App Services Application Settings and Connection Strings in ASP.NET Core – cjAliaga Core
タイプ違いで複数同じ名称っていけるんやっけ?その場合はどうなるんやろ。