Publishing ASP.NET Core 3.0 application as self-contained executable to Azure App Service

With Visual Studio 2019 we can publish ASP.NET Core 3.0 applications as self-contained executable. It’s specially useful for environments where ASP.NET Core 3.0 is not installed or where we don’t have permissions to install it. Here’s how to do it.

Here's how to run ASP.NET Core 3.0 applications on Azure App Services where .NET Core 3.0 is not available. Click To Tweet

All the magic happens when we create publishing profile for ASP.NET Core 3.0 application in Visual Studio and click Advanced… link.

Publish target is existing Azure App Service

If you have existing publishing profile then just open it and click on edit icon after Target framework.

Deployment mode: Self-Contained

Notice two options in this dialog:

  • Deployment mode. It is either Framework-Dependent (target framework must be available on App Service) or Self-Contained (no need to install target framework before deployment).
  • Target runtime. This must match the platform and hardware architecture of target machine. I went with win-x86.

Select target runtime, save profile and publish your application. If everything went okay then very soon new browser instance opens with your ASP.NET Core 3.0 application running on Azure App Service.

Serverless360 Logo

A portal focused on Operations and Support for Microsoft Azure Serverless services


Gunnar Peipman

Gunnar Peipman is ASP.NET, Azure and SharePoint fan, Estonian Microsoft user group leader, blogger, conference speaker, teacher, and tech maniac. Since 2008 he is Microsoft MVP specialized on ASP.NET.

    Leave a Reply

    Your email address will not be published. Required fields are marked *