Create sample ASP.NET 5 web application

Now that you have installed .NET 5 SDK, you can create sample ASP.NET application:

Create new folder:

mkdir ~/awesomeapp
cd ~/awesomeapp

Run dotnet new webapp command to create new project based on webapp template (ASP.NET Core Web App):

dotnet new webapp

Now you can build and run the generated sample ASP.NET application and expose it on port 5000:

sudo dotnet run --urls=http://0.0.0.0:5000

Once you see the output like this, you can use your web browser to access it:

Building...
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {2a99b2d8-d3c7-4be5-a6a2-242633678440} may be persisted to storage in unencrypted form.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://0.0.0.0:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /home/ubuntu/awesomeapp

On the AWS Console page, click on the EC2 link under the Compute section (or search for EC2) and locate your EC2 instance. Copy public IPv4 address of the instance.

Tags

Open Web browser and navigate to public IPv4 address of the instance, port 5000:

Tags

Once you verified that application is working, stop it by clicking Ctrl+C in order to run commands for the next modules.

Congratulations! You have .NET 5 web application is up and running on AWS Graviton2 instance!