Day 22: Configuring Instances with User Data
☁️ Day 22: Configuring Instances with User Data | 100 Days of Cloud (Azure) Welcome to Day 22 of the 100 Days of Cloud (Azure) series! In this lab, you’ll learn how to deploy an Azure Virtual Machine and automatically configure it as a web server using Nginx with user data. 📌 Lab Objective: Create an Azure VM and use a startup script to install and run Nginx, while allowing HTTP access from the internet. 🛠️ Task Requirements: VM Name: xfusion-vm Image: Ubuntu Use user data (bash script) to: Install Nginx Start Nginx service Allow HTTP (port 80) access 💻 Step-by-Step Solution (Azure CLI): 🔹 1. Login to Azure az login 🔹 2. Get Resource Group az group list --query "[].name" --output table 🔹 3. Create User Data Script vi script.sh Paste: #!/bin/bash apt-get update -y apt-get install -y nginx systemctl enable nginx systemctl start nginx 🔹 4. Create VM with Script az vm create \ --name xfusion-vm \ --resource-group YOUR_RESOURCE_GROUP \ --image Ubuntu2204 \ --size Standard_B1s \ --admin-username azureuser \ --generate-ssh-keys \ --custom-data script.sh 🔹 5. Open HTTP Port az vm open-port \ --resource-group YOUR_RESOURCE_GROUP \ --name xfusion-vm \ --port 80 🔹 6. Get Public IP az vm show \ --name xfusion-vm \ --resource-group YOUR_RESOURCE_GROUP \ --show-details \ --query publicIps \ --output tsv 🔍 Verify: Open in browser: http://PUBLIC-IP ✅ Nginx welcome page should appear 📚 What You’ll Learn: Using user data (bash script) in Azure Automating server setup Deploying Nginx on cloud VM Configuring NSG firewall rules Azure CLI usage 🌟 Why This Lab Matters: Automating VM configuration is a core DevOps skill, helping you deploy infrastructure faster, consistently, and at scale. 🎯 Series: 100 Days of Cloud (Azure) Keep building real-world cloud skills step by step. 🔔 Follow OtterTech for more hands-on labs and practical tutorials! #Azure #VirtualMachine #Nginx #CloudComputing #DevOps #Automation #NSG #Linux #100DaysOfCloud #OtterTech #Day22
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.