Create an ASP.NET Framework web app in Azure

Azure App Service provides a highly scalable, self-patching web hosting service.

This quickstart shows how to deploy your first ASP.NET web app to Azure App Service. When you're finished, you'll have an App Service plan. You'll also have an App Service app with a deployed web application.

If you don't have an Azure subscription, create a free account before you begin.


To complete this tutorial, install Visual Studio 2019 with the ASP.NET and web development workload.

If you've installed Visual Studio 2019 already:

  • Install the latest updates in Visual Studio by selecting Help > Check for Updates.
  • Add the workload by selecting Tools > Get Tools and Features.

Create an ASP.NET web app

Create an ASP.NET web app by following these steps:

  1. Open Visual Studio and then select Create a new project.

  2. In Create a new project, find and choose ASP.NET Web Application (.NET Framework), then select Next.

  3. In Configure your new project, name the application myFirstAzureWebApp, and then select Create.

    Configure your web app project

  4. You can deploy any type of ASP.NET web app to Azure. For this quickstart, choose the MVC template.

  5. Make sure authentication is set to No Authentication. Select Create.

    Create ASP.NET Web Application

  6. From the Visual Studio menu, select Debug > Start Without Debugging to run the web app locally.

    Run app locally

Publish your web app

  1. In Solution Explorer, right-click the myFirstAzureWebApp project and select Publish.

  2. In Publish, select Azure and click Next.

  3. Select Azure App Service (Windows) and click Next.

  4. Your options depend on whether you're signed in to Azure already and whether you have a Visual Studio account linked to an Azure account. Select either Add an account or Sign in to sign in to your Azure subscription. If you're already signed in, select the account you want.

    Sign in to Azure

    A resource group is a logical container into which Azure resources, such as web apps, databases, and storage accounts, are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.

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

    New App Service app

  6. For Resource group, select New.

  7. In New resource group name, enter myResourceGroup and select OK.

    An App Service plan specifies the location, size, and features of the web server farm that hosts your app. You can save money when you host multiple apps by configuring the web apps to share a single App Service plan.

    App Service plans define:

    • Region (for example: North Europe, East US, or Southeast Asia)
    • Instance size (small, medium, or large)
    • Scale count (1 to 20 instances)
    • SKU (Free, Shared, Basic, Standard, or Premium)
  8. For Hosting Plan, select New.

  9. In the Hosting Plan dialog, enter the values from the following table, and then select OK.

    Setting Suggested Value Description
    Hosting Plan myAppServicePlan Name of the App Service plan.
    Location West Europe The datacenter where the web app is hosted.
    Size Free Pricing tier determines hosting features.

    Create App Service plan

  10. In Name, enter a unique app name that includes only the valid characters are a-z, A-Z, 0-9, and -. You can accept the automatically generated unique name. The URL of the web app is http://<app-name>, where <app-name> is your app name.

  11. Select Create to create the Azure resources.

    Configure app name

    Once the wizard completes, the Azure resources are created for you and you are ready to publish.

  12. Select Finish to close the wizard.

  13. In the Publish page, click Publish. Visual Studio builds, packages, and publishes the app to Azure, and then launches the app in the default browser.

    Published ASP.NET web app in Azure

The app name specified in the App Service Create new page is used as the URL prefix in the format http://<app-name>

Congratulations! Your ASP.NET web app is running live in Azure App Service.

Update the app and redeploy

  1. In Solution Explorer, under your project, open Views > Home > Index.cshtml.

  2. Find the <div class="jumbotron"> HTML tag near the top, and replace the entire element with the following code:

    <div class="jumbotron">
        <h1>ASP.NET in Azure!</h1>
        <p class="lead">This is a simple app that we've built that demonstrates how to deploy a .NET app to Azure App Service.</p>
  3. To redeploy to Azure, right-click the myFirstAzureWebApp project in Solution Explorer and select Publish. Then, select Publish.

    When publishing completes, Visual Studio launches a browser to the URL of the web app.

    Updated ASP.NET web app in Azure

Manage the Azure app

  1. To manage the web app, go to the Azure portal, and search for and select App Services.

    Select App services

  2. On the App Services page, select the name of your web app.

    Portal navigation to Azure app

    You see your web app's Overview page. Here, you can do basic management like browse, stop, start, restart, and delete.

    App Service overview in Azure portal

    The left menu provides different pages for configuring your app.

Clean up resources

In the preceding steps, you created Azure resources in a resource group. If you don't expect to need these resources in the future, you can delete them by deleting the resource group.

From the Azure portal menu or Home page, select Resource groups. Then, on the Resource groups page, select myResourceGroup.

On the myResourceGroup page, make sure that the listed resources are the ones you want to delete.

Select Delete resource group, type myResourceGroup in the text box to confirm, and then select Delete.

Next steps