in ChatBot/Startup.cs [30:57]
public void ConfigureServices(IServiceCollection services)
{
Configuration["ApplicationInsights:InstrumentationKey"] = Environment.GetEnvironmentVariable("APPINSIGHTS_INSTRUMENTATIONKEY");
services.AddHttpClient().AddControllers().AddNewtonsoftJson(options =>
{
options.SerializerSettings.MaxDepth = HttpHelper.BotMessageSerializerSettings.MaxDepth;
});
// Create the Bot Framework Authentication to be used with the Bot Adapter.
services.AddSingleton<BotFrameworkAuthentication, ConfigurationBotFrameworkAuthentication>();
// Create the Bot Adapter with error handling enabled.
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
// Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
services.AddSingleton<IBot, ChatBot.Bots.ChatBot>();
services.AddLogging(loggingBuilder =>
{
loggingBuilder.AddConsole();
loggingBuilder.AddDebug();
});
services.AddApplicationInsightsTelemetry(Configuration);
services.AddSingleton<ISemanticKernelService, SemanticKernelService>();
}