Introduction
Motivation
Creating the Virtual Machine
Connecting to the Virtual Machine
Installing application dependencies and running the application
Create a Dockerfile using Visual Studio Code
Building a Docker image
Azure Container Registry
Pushing the local image to Azure Container Registry
Review
Next Steps
In this step, you will install the following tools in the virtual machine:
Next, you will use git to clone application sources and finally, you will build and launch the application.
To install .NET SDK:
wget https://dot.net/v1/dotnet-install.sh
This will download the installation script.
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 7.0
export PATH="/home/arm/.dotnet/:$PATH"
dotnet --list-sdsk
To install git, use the terminal of the virtual machine and type:
sudo apt-get install -y git-all
Wait for the installation to be completed. It will take a while.
You will now clone the application by typing:
git clone https://github.com/dawidborycki/People.WebApp.git
The application sources will be cloned to the People.WebApp folder. Change the working directory to:
cd People.WebApp/
Then, run the application so that it will listen for requests on port 8080:
dotnet run --urls "http://0.0.0.0:8080"
After completing this step, you will see the following output:
The application is ready and listening for the requests on port 8080. However, the network traffic is blocked on all ports except 22. You will need to configure the Network Security Group to enable the traffic.
To allow traffic on port 8080 for the Virtual Machine vm-arm64, proceed as follows:
In the Networking tab of the Virtual Machine, click the Add inbound port rule button (it’s on the right). This will open a new popup window Add inbound security rule:
Ensure the rule is configured as follows:
Then, click Add and wait for the security rule to be applied.
Once this is done, open your web browser and type the public IP address of your VM followed by 8080 port: 52.149.156.228:8080. You’ll see that the application is up and running:
This part of the tutorial has shown you how to create an arm64-powered Virtual Machine in Microsoft Azure, how to connect to that VM using SSH, and how to install the tools required to build and run the .NET web application. Finally, you have learned how to configure a network security group to enable inbound traffic on port 8080.