Solution :
You can try following options to fix your issue.
1. Fixed the issue using UseIISIntegration() on the WebHostBuilder.as follows:
public static void Main(string[] args)
{
var whost = new WebHostBuilder()
UseContentRoot(Directory.GetCurrentDirectory())
UseKestrel()
UseIISIntegration() // Must for Azure.
UseStartup<Program>()
.Build();
whost.Run();
}
2. Fixed the issue by setting the requestTimeout within the web.config as follows:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\PROJECT.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" requestTimeout="00:30:00"/>
</system.webServer>
</location>
</configuration>
3. Fixed the issue by following the below steps.
Firstly my application was .NET CORE 2.2 and I was trying to deploy it in the Azure web app.
I just Right Clicked on the project and clicked on the publish button.
After that Selected the publish profile which I had downloaded from Azure.
Next changed the deployment mode under the Summary to Self-Contained.
Finally clicked on publish button and it worked.