This project demonstrates how to deploy a simple .NET 8 Web API to an Azure Virtual Machine (VM) running Ubuntu. It was created as part of our group assignment in the Cloud Development program at JENSEN Yrkeshögskola.
- Sanali Sewwandi
- Patricio Martinez
- Gurdip Bola
- Sravani Obul Reddy Gari
- Cesar Tuncay
- Create and configure a secure Azure VM
- Deploy a .NET 8 C# Web API to the VM
- Expose the API securely using a Network Security Group (NSG)
- Run the API as a background service using systemd
- Limit access to specific IPs for better security
- Created a Resource Group, Virtual Network, and Subnet in Azure.
- Deployed an Ubuntu Linux VM.
- Created and applied NSG rules:
- Opened port 22 for SSH (restricted to home IP)
- Opened port 5062 for API access (restricted to school IP)
- Cloned the GitHub repo on the VM:
git clone https://github.com/RMSSanali/vm-groupproject.git cd vm-groupproject/ApiForGroup - Built and ran the API using .NET 8:
dotnet build dotnet ApiForGroup.dll --urls "http://0.0.0.0:5062" - Confirmed that the API is running and accessible from the browser or via curl.
Created a groupapi.service file to ensure the API starts automatically on reboot:
sudo systemctl enable groupapi.service
sudo systemctl start groupapi.service- Used Azure IAM to assign roles:
- Contributor:
azurejensen074 - Reader:
Fredrik.dahl
- Contributor:
- Limited API access (port 5062) to school IP only
Once deployed, the API can be accessed via:
http://<your-vm-public-ip>:5062
Note: Access is restricted to school IP for security.
Use your browser or a tool like curl/Postman to access:
GET http://<public-ip>:5062/status
Expected response:
"API is running"
- .NET 8
- C#
- Ubuntu Server 22.04 LTS
- Azure Virtual Machine
- Azure Network Security Groups (NSG)
- systemd (Linux service)
The project was completed before the final deadline: 25 April 2025, 15:00.
vm-groupproject/
├── ApiForGroup/ # Main API code
├── .gitignore
└── README.md # You're reading it! 😄
✔ Create infrastructure in Azure
✔ Deploy and expose a C# API on a secure port
✔ Test API functionality from client
✔ Apply security rules (NSG, IAM)
✅ Project Completed
📢 Ready for demonstration!
SSH and API access are IP-restricted for security purposes.
For questions, contact any team member or open an issue on this repo.