Running Go behind IIS

Sutean Rutjanalard
2 min readOct 1, 2018

--

Since 2014 there was 4 simple steps to run Go Language in Azure Website but now its outdated. By HttpPlatformHandler has been replaced by ASP.NET Core Module. But anyway I’m forced to run Go on Windows Server. So here is how.

  1. Start with simple go program that can serve as Http Service.

Point is getting the right environment variable from ANCM call ASPNETCORE_PORT

So the the port :1234 on this picture is ASPNETCORE_PORT on your environment variable, you can find more environment variable that set by ANCM from here.

2. Create web.config to Host on IIS.

It’s simple as normal asp.net core exe application.

3. To run on IIS, Create Application pool with No Managed Code.

And config Physical path to web.config and our .exe file.

Then Start, and go to http://localhost:<your setup port>(for this setup just http://localhost).
That’s all.

The problem that I can not run on HttpPlatformHandler, because I have to use SSE to service clients but the HttpPlatformHandler itself have 8k buffer so that the SSE message can not sent to client instantly but Update version of HttpPlatformHandler (ASP.NET Core Mudule) already fix that problem but it’s have internal change so the same config on HttpPlatformHandler can not use with ASP.NET Core Mudule.

--

--