Skip to content

An all-in-one Azure IoT Operations lab that is an automated full deploy into a VM in Azure that runs Arc-Enabled Kubernets on K3s, AIO, and IoT Deivce Simulation.

License

Notifications You must be signed in to change notification settings

matthansen0/azure-iot-ops-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Azure IoT Operations Lab (Ubuntu 24.04 + K3s + Device Simulation)

Azure Arc Azure IoT Ubuntu 24.04 K3s

Spin up an Ubuntu VM and let it self‑provision an end‑to‑end Azure IoT Operations (AIO) lab: K3s, Arc connect, AIO foundation, the embedded quickstarts (devices, assets, data flow), and a simulator — all from Azure Cloud Shell with two scripts. Tear it down with one more.

🖼️ Architecture Diagram

Diagram


✨ What this automates

Note

There is existing automated builds in the above documentation to run this in Codespaces, but the purpose of this repo is to build it out in a VM for a longer-term lab.


⚠️ Prerequisite: Azure CLI Login

The assumption is that this deployment will be done from bash in Azure Cloud Shell. Even if you are in Cloud Shell already, it's a good idea before running the deployment script to make sure that you've logged in to Azure CLI, to set the subscription and get a refreshed token:

az login

🔒 Lab Security notes

  • This lab uses your own Azure user credentials for all operations.
  • SSH access to the VM is opened via a Network Security Group (NSG) rule.
  • A local SSH key pair is generated on your local machine for authentication.

🧪 Quick start

git clone https://github.com/matthansen0/azure-iot-ops-lab.git
cd azure-iot-ops-lab
chmod +x deploy.sh destroy.sh get-insights.sh

Deploy the VM and copy the install script

./deploy.sh \
  --subscription "<SUB_ID>" \
  --location "eastus2" \
  --compute-rg "rg-aioCompute" \
  --ops-rg "rg-aioOps" \
  --vm-name "aio24" \
  --ssh-public-key "$HOME/.ssh/id_rsa.pub" \
  --storage-account "aio$(date +%s)" \
  --schema-registry "aioqs-sr" \
  --schema-namespace "aioqs-ns"

SSH into the VM and run the install script

ssh -i ~/.ssh/id_rsa azureuser@<VM_PUBLIC_IP>
sudo bash /usr/local/bin/aio-install.sh

The script will prompt you to authenticate with Azure using a device code, and will take between 30-45 minutes to complete.

Install Script

Verify (optional)

# On the VM (or via Arc)
kubectl get nodes
kubectl get pods -n azure-iot-operations
kubectl get pods -n azure-arc-containerstorage
kubectl get pods -n cert-manager

# In Azure
az iot ops list -g rg-aioOps -o table

View install logs on the VM:

tail -40 /var/log/aio-install.log

Tip

You will be able to see finalized progress of the deployment once there is device messages being sent into the IoT Hub.


🗑️ Clean up

./destroy.sh --compute-rg "rg-aioCompute" --ops-rg "rg-aioOps"

🤝 Contributing

Contributions are welcome! If you have suggestions, bug reports, or improvements, please open an issue or submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

Please ensure your pull request adheres to the existing style and includes relevant documentation or examples where appropriate.


📝 To-Do

  • Add "next steps" automation for data ingestion and visualization
  • Add support for password Azure-managed SSH key resources for VM login
  • Add cost estimation or resource summary
  • Create architecture diagram

About

An all-in-one Azure IoT Operations lab that is an automated full deploy into a VM in Azure that runs Arc-Enabled Kubernets on K3s, AIO, and IoT Deivce Simulation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages