ASP.NET First App

You'll learn how to create and deploy your first ASP.NET Web Application.

Create an ASP.NET web app

Step 1: In the terminal window, create a new folder named MyFirstDotNetWebApp, and open it in Visual Studio Code.

mkdir MyFirstDotNetWebApp
code MyFirstDotNetWebApp

Step 2: In Visual Studio Code, open the Terminal window by typing Ctrl + `.

Step 3: In Visual Studio Code terminal, create a new .NET web app using the dotnet new webapp command.

dotnet new webapp -f net6.0

Step 4: From the Terminal in Visual Studio Code, run the application locally using the dotnet run command.

dotnet run --urls=https://localhost:5001/

Step 5: Open a web browser, and navigate to the app at https://localhost:5001.

You'll see the template ASP.NET Core 6.0 web app displayed in the page.

Update the app and redeploy

Follow these steps to update and redeploy your web app:

  1. Open Index.cshtml.

  2. Replace the first <div> element with the following code:

<div class="jumbotron">
    <h1>.NET 💜 </h1>
    <p class="lead">Example .NET app to Azure App Service.</p>
</div>

Save your changes.

Last updated