Azure App Service: Publish Asp.net Core Web App

Introduction

Azure App service is an HTTP based service for hosting web applications, Rest APIs and mobile back ends, you can develop in your known language using .Net, .Net core, Java, Ruby, Node.JS, PHP and Python. Asp.net core applications run and scale with both Windows and Linux based environments. In this article you will learn more about how to create web apps using asp.net core and publish applications into Azure. 

Prerequisites

  • Download and install the latest Visual Studio 2019.
  • Create new Account / Login Azure.

Create Asp.net Core App

You can start to create an asp.net core app using visual studio. Open Visual Studio and Select to create a new project template as “Asp.net core web application”. you can select your know language, in this demo, we are selecting as “C#” language.

Azure App Service:  Publish Asp.net Core Web App

Configure new Project

Second step, Provide the project name, location, solution name and click on create

Azure App Service:  Publish Asp.net Core Web App

Application Template

Microsoft provides different types of templates for creating apps. We have to create a web application for a demo, so you need to select “Web Application” and Click on “Create”.

Azure App Service:  Publish Asp.net Core Web App

Once created the application, solution will be generated with required file as below

Azure App Service:  Publish Asp.net Core Web App

Run the Application in Local

Visual Studio used a default template so you have a working web app right now by entering a project name and selecting a few options. This is a simple auto generated project, Tap F5 to run the app in debug mode or Ctl-F5 in non-debug mode.

Visual Studio starts IIS Express and runs the app. the address bar shows localhost and port number. The localhost always points to local computer.

The default template as like below with banner image and sample content.

Azure App Service:  Publish Asp.net Core Web App

Publish Web App

publish your web app, you must first create and configure a new App Service that you can publish your app to Azure and also follow the below steps .

Step 1: Right Click on Project or Solutions

Step 2: Select “Publish” options on the right click menu.

Step3: The below windows will pop up for the first time. You can select “Azure” as a publishing platform.



Azure App Service:  Publish Asp.net Core Web App

You can select the Azure App service and operating system which you want to deploy your web app in the below window and click on next.

Azure App Service:  Publish Asp.net Core Web App

Select either create an account or Sign in to sign in to your Azure subscription. If you're already signed in, select the account you want.

Azure App Service:  Publish Asp.net Core Web App

To the right of App Service instances, click on +.

Azure App Service:  Publish Asp.net Core Web App

Select subscription, Resource group and hosting plan in the following screen


  • Subscription – Select the subscription that is listed or select a new one from the drop-down list.
  • Resource group - select New. In New resource group name, enter the resource group name and select OK.
  • Hosting Plan – Select the hosting plan and click on create

Azure App Service:  Publish Asp.net Core Web App

Once the wizard completes, successfully completed build and publish web application into Azure, you can refer and try published URL in browser

Azure App Service:  Publish Asp.net Core Web App

You can navigate to published url and verify your published website available in Azure and online

Azure App Service:  Publish Asp.net Core Web App

You can also navigate to Azure portal and select on All resource and check App service and AppService plan is hosted under your resource. You can verify and manage app service plans in azure portal.

Azure App Service:  Publish Asp.net Core Web App

Summary

In this article, you have learned about creating Web Application using Dotnet core and published applications into Azure. if you have any questions/feedback/ issues, please write them in the comment box.

0 Comments

Featured Post

Improving C# Performance by Using AsSpan and Avoiding Substring

During development and everyday use, Substring is often the go-to choice for string manipulation. However, there are cases where Substring c...

MSDEVBUILD - English Channel

MSDEVBUILD - Tamil Channel

Popular Posts