Razor Pages is a new feature of ASP.NET Core Model-View-Controller (MVC). Razor Pages simplifies coding page-focused scenarios to increase productivity. This topic describes how to create an ASP.NET Core application and deploy the application in Web+. It uses a Razor Pages web application as an example.


Configure an ASP.NET Core environment

Step 1: Use Visual Studio to create an application

  1. Use Visual Studio to create a new project and select Web Application.
  2. On the Configure your new project page, enter webplusdemo in the Project name field and click Create.
  3. In Web+, you can configure HTTPS for a reverse proxy or SLB. In this example, the HTTPS URL is removed and only the HTTP URL is retained. The following figure shows how to modify the applicationURL attribute in the Properties/launchSettings.json file.
  4. Open a browser and enter http://localhost:5000/ in the address bar to visit the homepage of the application.Visit the homepage of the .NET Core application

Step 2: Package the application

  1. On the top navigation bar of Visual Studio, choose Build > Publish to Folder, and specify a target directory.
  2. You can open a shell and navigate to the directory to view generated files.View the generated files of the .NET Core application
  3. Use the following command to archive the project and name the deployment package webplusdemo.zip.
    zip -r webplusdemo.zip . /

Step 3: Deploy an application in Web+

  1. Log on to the Web App Service console and select the required region in the upper-left corner of the page.
  2. On the Overview page, click Create in the upper-right corner of the Last Updated Deployment Environments section.
  3. In the Basic Information step, select ASP.NET Core in the Tech Stack Type field and enter an application name and description. Click Next after the configuration is complete.Create a .NET Core application in the Web App Service console
  4. In the Environment Information step, enter a environment name, select Upload Local Application in the Deployment Package Source field, and upload the webplusdemo.zip deployment package. After configuring the deployment package version, click Creation Complete.
  5. In the Creation Complete step, click View Application or Creation Complete to go to the Overview tab of the Application Details page. Click the name of an environment to go to the Overview tab of the Environment Details page. Then, click the link next to the Public IP Address label to visit the homepage of the application.Visit the homepage of a .NET Core application