Direct Line App Service extension disconnect issues
Published Apr 26 2022 02:20 PM 1,080 Views

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!!

1 Comment
Version history
Last update:
‎Apr 26 2022 02:28 PM
Updated by:
www.000webhost.com