The specified CGI application encountered an error and the server terminated the process The specified CGI application encountered an error and the server terminated the process azure azure

The specified CGI application encountered an error and the server terminated the process


I was able to solve this issue by removing forwardWindowsAuthToken from the web.config file under wwwroot.

  1. Navigate to src/ProjectName/wwwroot
  2. Open the web.config
  3. In the httpPlatformremove the forwardWindowsAuthToken="true/false" property

Redeploy and mine worked fine.

See here https://github.com/aspnet/Hosting/issues/364 for plenty of discussion


Short Answer

For us the fix was to to UseIISIntegration() on the WebHostBuilder.

public static void Main(string[] args){    var host = new WebHostBuilder()        .UseContentRoot(Directory.GetCurrentDirectory())        .UseKestrel()        .UseIISIntegration() // Necessary for Azure.        .UseStartup<Program>()        .Build();     host.Run();}

More Details

Our web.config looks like this:

<?xml version="1.0" encoding="utf-8"?>         <configuration>                                <system.webServer>                                 <handlers>                                     <add name="aspNetCore"                             path="*"                                       verb="*"                                       modules="AspNetCoreModule"                     resourceType="Unspecified"/>               </handlers>                                    <aspNetCore processPath="%LAUNCHER_PATH%"          arguments="%LAUNCHER_ARGS%"                    stdoutLogEnabled="false"                       stdoutLogFile=".\logs\stdout"                  forwardWindowsAuthToken="false"/>      </system.webServer>                            </configuration>       

Our project.json looks like this:

{  "dependencies": {    "Microsoft.NETCore.App": {      "version": "1.0.0",      "type": "platform"    },    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-*",    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*"  },  "tools": {    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"  },  "frameworks": {    "netcoreapp1.0": {}  },  "buildOptions": {    "emitEntryPoint": true  },  "publishOptions": {    "include": [      "web.config"    ]  },  "scripts": {    "postpublish": [      "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"    ]  }}

Our nuget.config looks like this:

<?xml version="1.0" encoding="utf-8"?><configuration>  <packageSources>    <add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />  </packageSources></configuration>


This can also happen if you have an infinite loop in your code.