Deployment of .NET Web Application using App services
Hi there!
Welcome… I am starting this series where I’ll be explaining various services provided by Microsoft Azure in detail as well as how the deployment of these services can be automated. It’ll be a one-stop trusted solution for y’all. Please, continue reading and I hope it’s helpful :)
In this article, I’ll explain the Azure App Service plan and Azure App service. I will also explain the detailed steps to deploy a .NET web application using the Azure App service.
Azure App Service plan and Azure App Service
Azure App Service Plan defines a set of compute resources for a web app to run. Azure functions also have the option to run in the Azure app service plan. So, when we create an App Service plan, we have to put that plan in a defined Azure region, and a set of compute resources is created for that App service plan in that particular region that we selected. Therefore, the app resources (Azure app service or Azure functions) we put in this particular App service plan run on these defined compute resources (as per the App Service Plan).
App Service is an Azure Managed hosting service (PAAS) for web apps and mobile back-ends. We can easily build, deploy, maintain, and scale web apps as code or containers.
Below, I have deployed a sample.NET web Application using the Azure App service.
Step-1 — I have utilized the Visual Studio sample .NET web app code. In this step, open Visual Studio code, new project > ASP.NET core web app > Configure your new project> Additional Information.
Step-2 — Once the project has been created in Visual Studio, go ahead and publish this web application on Azure.
Publish > Azure -Next> Azure App Service ( Windows)> Next.
Note: After clicking on Next we’ll have 2 options:
1. To publish the .NET application code on an existing app service plan — app service or
2. To publish a newly deployed app service plan as well as the app service
A. Let’s first elaborate on the case where the app service already exists in the Azure environment where we want to deploy the .NET code.
Step 1.1 Select the resource group in which the app service already exists and expand it. You’ll be able to view the app service name. Select MT-webappservice> next.
Step 1.2 Once we click on Next, the .NET application code will start publishing to the Azure App service. This will take a few minutes (depending on your application)
Step 1.3 Once it is published successfully, you’ll see a confirmation as displayed below:
Step 1.4 We can see on the Azure portal that the application has been successfully published. Go ahead and run the URL.
B. Deploy a new Azure app service and publish the .NET code from Visual Studio
Step 2.1 Select Create New. This will open a prompt where you can deploy your app service (App service name, subscription name, hosting plan as well as the resource group can be modified)
Step 2.2 Once the Azure app service is deployed, select next. It will initialize the publishing of the application to the selected newly deployed Azure app service.
Step 2.3 Click on Publish and the publishing of the .NET code will be started ( it will take a few minutes).
Step 2.4 You will see the below prompt once the code is successfully published to the newly deployed Azure App service.
There are multiple features available by Azure for managing and upscaling the web App based on your requirements. I will be discussing those in the future articles :)
About me:
Hi 👋, I’m Muskan Tomar , a passionate Engineer from India working on Cloud & DevOps projects for 3 years now.
Azure Solutions Architect | Azure DevOps |SecurityEngineer| dministrator Associate| Kubernetes & Docker | Terraform
Reach me out on:
LinkedIn: https://www.linkedin.com/in/muskan -tomar-b3566615a/
Email: muskantomar001@gmail.com
Portfolio: muskantomar001.github.io