C# WebMethod does not receive ClientDisconnectedToken on Azure

564 Views Asked by At

I have a WebService.asmx with a long task running web method. The duration is under the executionTimeout and the Azure limit of 230 seconds. So, the request can await this 30 seconds operation and receive a response.

I want to stop the server operation, when the client disconnect.
So i read the httpContext.Response.ClientDisconnectedToken and passed that cancellationToken to my process.

I prepared a client that call this webMethod and set a timeout of 10 seconds, after that it will disconnect.

When i publish the webApplication on a on premise IIS, it works correctly and stops immediatly my server task when the client disconnect prematurely.

When i publish that on a App Service on Azure, it didn't recieve the client disconnection event.

Why the clientDisconnectedToken doesn't work?
I have a project available as demo and a published web service to test if needed.

0

There are 0 best solutions below