https://github.com/harmonyoma/azure-vm-deployment
🚀 This project demonstrates how to deploy a Virtual Machine on Azure using Azure CLI and automate the process with a Bash script. It covers resource group creation, VM setup, opening network ports, fetching the public IP, and connecting via SSH. A resource cleanup option is included to help manage cloud costs. Ideal for beginners.
https://github.com/harmonyoma/azure-vm-deployment
azure-cli bash beginner-friendly-project cloud-automation cloud-computing devops shell-script virtual-machine vm-deployment
Last synced: about 2 months ago
JSON representation
🚀 This project demonstrates how to deploy a Virtual Machine on Azure using Azure CLI and automate the process with a Bash script. It covers resource group creation, VM setup, opening network ports, fetching the public IP, and connecting via SSH. A resource cleanup option is included to help manage cloud costs. Ideal for beginners.
- Host: GitHub
- URL: https://github.com/harmonyoma/azure-vm-deployment
- Owner: HARMONYOMA
- Created: 2025-06-28T00:41:21.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T00:41:59.000Z (12 months ago)
- Last Synced: 2025-06-28T01:25:10.315Z (12 months ago)
- Topics: azure-cli, bash, beginner-friendly-project, cloud-automation, cloud-computing, devops, shell-script, virtual-machine, vm-deployment
- Language: Shell
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚀 Azure Virtual Machine Deployment with Bash Automation
## Project Overview
This project demonstrates how to create and deploy a Virtual Machine (VM) on Microsoft Azure using Azure CLI.
I also automated the entire process using a Bash script to make the deployment faster and more efficient.
The script:
- Logs into Azure
- Creates a Resource Group
- Deploys a Virtual Machine
- Opens port 80 to allow web traffic
- Retrieves the public IP address of the VM
- Provides an option to automatically clean up resources to avoid extra costs
---
## Table of Contents
- [Project Overview](#project-overview)
- [Technologies Used](#technologies-used)
- [Prerequisites](#prerequisites)
- [Folder Structure](#folder-structure)
- [How to Use the Bash Script](#how-to-use-the-bash-script)
- [Manual Deployment Steps](#manual-deployment-steps)
- [Learnings](#learnings)
- [Resources](#resources)
- [image](#image)
---
## Technologies Used
- Azure CLI
- Ubuntu 22.04 LTS Virtual Machine
- Bash scripting
---
## Prerequisites
- Azure CLI installed on your machine
- An active Azure subscription
- Basic terminal/command line knowledge
- SSH key setup (Azure CLI can auto-generate this)
---
## Folder Structure
```bash
azure-vm-deployment/
├── image/ # Screenshot of successful deployment
├── README.md #Project documentation
└── vm-deployment.sh #Bash automation script
```
---
## Manual-deployment-steps
If you want to manually deploy the VM instead of using the Bash script, follow these steps:
### 1. Log into Azure using:
```bash
az login
### 2. Create a Virtual Machine using Azure CLI.
```bash
az vm create \
--resource-group \
--name \
--image Ubuntu2204 \
--admin-username azureuser \
--generate-ssh-keys
### 3. Open port 80 to allow web traffic:
```bash
az vm open-port --port 80 --resource-group --name
### 4. Retrieve the public IP address of the VM:
```bash
az vm list-ip-addresses --name --resource-group
### 5. Connect to the VM via SSH:
```bash
ssh azureuser@
```
---
## How to Use the Bash Script
### 1. Make the Script Executable
In your terminal, navigate to the project folder and run:
```bash
chmod +x vm-deployment.sh
### 2. Execute the script with
```bash
./vm-deployment.sh
### 3. After the script finishes, it will display the SSH command.
Use it to connect to your VM:
```bash
azureuser@
```
---
## Learnings
- How to deploy and manage Azure cloud resources using CLI.
- How to automate virtual machine deployment with Bash.
- How to securely connect to virtual machines using SSH.
- The importance of cleaning up resources to prevent unnecessary cloud costs.
---
## Resources
- Azure CLI Documentation
- Azure VM Quickstart Guide
- HARMONYOMA/azure-vm-deployment.
---
## Image
- Screenshot of successful deployment