Daniel Dreier

Getting an ASP.NET Core app running in Azure

A while back I started working on a small web app project to familiarize myself with ASP.NET Core. I settled on putting something together to tag/categorize a large set of animated GIFs.

As an extension of writing the app, I also wanted to take a stab at getting the app to run in Azure. I didn't go into the setup expecting anything to work right out of the box. Getting the app deployed from my local Git repository was easy and painless. But upon trying to browse to the app I was greeted by a 502 error page and the following error in the Application's Event Log:

Application 'MACHINE/WEBROOT/APPHOST/IMAGETAGGERTEST' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline '"%LAUNCHER_PATH%" %LAUNCHER_ARGS%', ErrorCode = '0x80070002 : 0.

After a fair amount of Google-ing I managed to find an answer on StackOverflow (where else?) that points to the two environment variables, %LAUNCHER_PATH% and %LAUNCHER_ARGS%, that are used by Visual Studio to fire up IISExpress. But that's it.

So all it took was replacing those two variables in the app's web.config file. Replacing %LAUNCHER_PATH% with dotnet and %LAUNCHER_ARGS% with the relative path to my application's DLL file.

Share this post: