Skip to content

Deploying to Azure App Service #44

@kirse

Description

@kirse

I had to slightly modify the base Giraffe template in order to successfully deploy it to an Azure App Service:

  1. (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.
  2. Added a PackageReference to the fsproj for Microsoft.AspNetCore.Server.IISIntegration (1.1.*)
  3. Added UseIISIntegration() to the WebHostBuilder init
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationRequest to change or extend documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions