Create ASP.NET Web App In Azure

Prerequisites

Let’s Start

Create an ASP.NET MVC web application:
  1. Open Visual Studio from File menu, and then click New, Project.

  2. Under templates, select Visual C#, Web, then ASP.NET Web application.

  3. Provide an appropriate project name, in my case its ‘DSWebAppSample1’,

    DSWebAppSample1

  4. Click OK. Select ‘MVC’ from ASP.NET templates in the next screenshot. Click ‘Change Authentication’ button. Make sure ‘Host in the Cloud’ checkbox is checked and ‘web app’ selected.

    apps

  5. Select ‘No Authentication’, OK, and then click OK.

  6. If you are not already logged in to Azure, Visual Studio prompts you to do so. Sign in with the ID and password of the account that you use to manage your Azure subscription.

  7. Once you're signed in, the Configure Microsoft Azure Web App Settings dialog box asks you what resources you want to create. Provide a unique Web app name (this would b the first part of URL). Select ‘Create a new web service plan;' give some meaningful name. Create a new resource group and give some meaningful name. Select a region based on your location. Click OK.

    configure

  8. It will take few seconds to create the project. It will ask to select a source control and if you have TFS or Git configured, you can select one otherwise cancel the popup.

    tfs

  9. Once the project is created, you can check Azure App Service Activity window to see details.

    project

  10. Do some visible changes: Go to Project, Views, then click Home. Open index.cshtml and put some personalized content in first div. Now we are all set.

    index
Deploy web app to Azure
  1. In Solution Explorer, select project, then right click and Publish. It will open publish web dialog box and click ‘Next’.

    next

  2. In configuration, ensure ‘Release’ is selected and click Next, then Publish. It will take some time to publish on Azure, you can see the process in the output window:

    output

  3. Once it’s published, it will open in browser.

    browser

  4. Your web app is in Azure now, anyone with the URL can access this site.
Server Explorer- Open & edit remote files
  1. You can use server explorer to open and edit remote files for debugging or minor changes.

  2. Changes done here will directly reflect on the web app without any deployment.

  3. Open Server explorer in Visual Studio, Azure and then select App Service.

  4. Select ‘Your App Service’ and then ‘Your Web application.

  5. Expand Web application; go to Files, Views, Home, then click Index.cshtml

    index

  6. Make some visual changes in html and save the file.

  7. Refresh the page in browser and the latest changes should be available.

    browser

Up Next
    Ebook Download
    View all
    Learn
    View all