CLI & PowerShell
Azure CLI Scenarios¶
🔹 Exercise 1: Setup & Resource Groups¶
Login to Azure CLI
Set your active subscription
Create a resource group
Verify it
🔹 Exercise 2: Storage Account + Blob¶
Create a storage account
az storage account create \
--name mystorage123xyz --resource-group MyRG \
--location eastus --sku Standard_LRS --kind StorageV2
Create a container
Upload a CSV file
az storage blob upload \
--account-name mystorage123xyz --container-name rawdata \
--name sample.csv --file ./sample.csv
List blobs
3## 🔹 Exercise 3: SQL Database
Create a SQL server
az sql server create \
--name my-sql-server123 --resource-group MyRG \
--location eastus --admin-user myadmin --admin-password MyP@ssw0rd!
Create a database
az sql db create \
--resource-group MyRG --server my-sql-server123 \
--name mydb --service-objective S0
Show details
🔹 Exercise 4: Virtual Machine¶
Create a Linux VM
az vm create \
--resource-group MyRG --name MyVM \
--image UbuntuLTS --admin-username azureuser --generate-ssh-keys
Check running VMs
Stop the VM
Start it again
🔹 Exercise 5: Build a Mini Data Lake Pipeline¶
Goal: Create a Data Lake storage, upload raw data, then use queries to check it.
- Create a storage account with hierarchical namespace (Data Lake Gen2):
az storage account create \
--name mydatalake123 --resource-group MyRG \
--location eastus --sku Standard_LRS --kind StorageV2 \
--hierarchical-namespace true
Create a container for raw data:
Upload multiple files (CSV, JSON):
for file in ./data/*; do
az storage blob upload \
--account-name mydatalake123 \
--container-name raw \
--name $(basename $file) \
--file $file
done
Verify using query: