-
Notifications
You must be signed in to change notification settings - Fork 267
Description
I had to slightly modify the base Giraffe template in order to successfully deploy it to an Azure App Service:
- (Optional) In the Azure Portal, first clear out all the "Default Documents" in the "Application Settings" for the targeted App Service. May also need to delete them from wwwroot.
- Added a PackageReference to the fsproj for Microsoft.AspNetCore.Server.IISIntegration (1.1.*)
- Added UseIISIntegration() to the WebHostBuilder init
- Published the app with a web.config similar to the one below (alongside app DLL; app DLL name will vary)
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\giraffe.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> </system.webServer> </configuration>
With those changes, anyone should be able to follow this ASP.NET Core Azure tutorial and deploy the giraffe-template Nuget pkg to their Azure App Service.
Caveats: Not really an ASP.NET Core expert yet, so I'll let you decide how to manage that web.config situation. It gets generated into "PubTmp" if you publish a C# ASP.NET Core app from VS2017, so I'm not sure at what stage it'd be created in a vscode workflow (dotnet publish doesn't appear to generate it). Also, it's possible to directly host w/ Kestrel on Azure, but general rec is to use IIS/Nginx as a reverse proxy.