Recently we saw multiple scenarios where Direct Line App Service extension is getting disconnected without any reason, or after the process restart or configuration changes not able to establish connection through NamedPipes which is resulting in Bot downtime.
Symptoms of this issue is when you browse https://<your_app_service>.azurewebsites.net/.bot it display as below
{"v":"123","k":true,"ib":false,"ob":false,"initialized":true}
product group is aware about the ongoing issue and currently working on releasing permanent fix.
As a workaround to mitigate the issue we can delay the NamedPipe connection as below in startup.cs.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseDefaultFiles()
.UseStaticFiles()
.UseWebSockets()
// Allow the bot to use named pipes.
//.UseNamedPipes(System.Environment.GetEnvironmentVariable("APPSETTING_WEBSITE_SITE_NAME") + ".directline")
.UseRouting()
.UseAuthorization()
.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
//Delay NamedPipes connection by 10 sec
Task.Run(() =>
{
Thread.Sleep(10000);
app.UseNamedPipes(System.Environment.GetEnvironmentVariable("APPSETTING_WEBSITE_SITE_NAME") + ".directline");
});
Hope this helps!!
Updated Apr 26, 2022
Version 2.0Ramchandra_Kudtarkar
Former Employee
Joined August 26, 2020
IIS Support Blog
Follow this blog board to get notified when there's new activity