.NET 5: Deploying web apps with Azure App Service
Tags: dotnet, azure, cloud, webdev
Published: 2020-11-13 19:32:37

The innovation behind .NET is to integrate all Microsoft development tools: libraries, languages, technologies, and purposes under the same framework, which are useful to the developer or company that needs it.

In this sense, .NET introduces a unified platform in its ecosystem to support the construction of literally anything from desktop applications to video games, or web or mobile applications, there are really many things we can do.

![](https://dev-to-uploads.s3.amazonaws.com/i/f941quin2mkrqz0vopgw.png)

Recently, in the .NET Conf 2020, the .NET version 5.0 has been officially released. .NET 5 is committed to a big change in relation to the concept of development, since all kinds of applications, whether desktop, console, web, or mobile, will be made with a single cross-platform framework and with great power. This will allow you to have a unique .NET runtime that can be used anywhere and for any type of development or device.

Now, one of the things that many wonders, when a new version of .NET is released, is about how we can deploy applications in the cloud with this new version, in this case, applications with .NET 5. Well, in the case of Azure, Microsoft has made it possible for applications developed with .NET 5 to be deployed from day zero thanks to its new feature [Early Access Runtime](https://github.com/Azure/app-service-linux-docs/blob/master/Runtime_Support/early_access.md), that will enable not only .NET 5 applications but each later version of .NET from now on.

All right, given this contextualization about the new version of .NET, let's look in a few steps at an example of how to deploy an application developed on .NET 5 to Azure App Service.

##**.NET 5 SDK**

The first thing we'll need is to have the .NET 5 SDK installed.

![](https://dev-to-uploads.s3.amazonaws.com/i/cjhtf0714ih0m8lwn8ir.png)

***Download link***: [https://dotnet.microsoft.com/download](https://dotnet.microsoft.com/download).

##**Project with ASP.NET 5**

With the .NET SDK 5, we now need to target the project we want to deploy to Azure, for this case, let's create a new one to exemplify.

![](https://dev-to-uploads.s3.amazonaws.com/i/zw7mll91d5hezabcb6bm.png)

In this case with .NET 5:

```xml
<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

</Project>
```

##**Azure App Service**

To deploy our project to an App Service resource, we have two considerations that can be taken into account to specify that the framework and version of our application correspond to .NET 5. 

Initially, the first way to specify the framework and version is when creating the App Service resource in the '`Runtime stack` option in the `Instance Details` section:

![](https://dev-to-uploads.s3.amazonaws.com/i/rcrhdqky76dqjz10q7bp.png)

The second way is when we already have the resource created, in case we want to switch from .NET Core 3.1 to .NET 5 for example. For this case, we will have to go to the App Service resource in question to the `Configuration` option and the `General settings` tab, here we must select the .NET stack with its .NET version 5.

![](https://dev-to-uploads.s3.amazonaws.com/i/o9mwshvccz1bcrj6w6c3.png)

With these specifications, we'll be ready to deploy our application with .NET 5 to Azure.

##**Publishing from Visual Studio 2019**

For this example, we'll deploy our web application from Visual Studio 2019. To do this, you only have to right-click on the main project and select `Publish`.

![](https://dev-to-uploads.s3.amazonaws.com/i/cctezwpcxe1jar75s323.png)

Next, we'll need to specify our Azure App Service resource and finally, we'll be able to publish our app.

![](https://dev-to-uploads.s3.amazonaws.com/i/z96ugrai4yl5t7qbgukl.png)

By the end of this process, our app will already be published to Azure:

![](https://dev-to-uploads.s3.amazonaws.com/i/5l6mmgnav2tjtalovpw9.png)

##**What's next?**

With these simple steps, we've seen how to deploy a web application developed on the new version of .NET 5. Surely in the coming days, we will see more use cases for the development of multipurpose cross-platform applications. In the meantime, here are some additional materials to expand our knowledge of .NET:

+ [Deploy DotVVM and .NET Core web applications to Azure (Everything you need to know)](https://dev.to/dotvvm/deploy-dotvvm-and-net-core-web-applications-to-azure-everything-you-need-to-know-3651).
+ [Building a Dashboard with ASP.NET Core and DotVVM](https://dev.to/esdanielgomez/building-a-dashboard-with-asp-net-core-and-dotvvm-349).
+ [Working with web services through ASP.NET Core and DotVVM (A step by step guide)](https://dev.to/dotvvm/working-with-web-services-through-asp-net-core-and-dotvvm-a-step-by-step-guide-2le).

**Thank you for reading.**

If you have any questions or ideas that you need to discuss, it will be nice to be able to collaborate and together exchange knowledge with each other.

¡See you on [Twitter](https://twitter.com/esDanielGomez)! :)