What is the VM agent and the Custom Script Extension vs cloud-init?
IntermediateConceptCompute and App Platforms
Answer
The Azure VM agent (waagent on Linux) talks to the platform and runs extensions (Custom Script, Azure Monitor Agent, Entra login, Key Vault).
- cloud-init runs at first boot from custom data (
--custom-data cloud-init.yaml), handles packages, users, files. Preferred for Linux bootstrapping. - Custom Script Extension downloads and runs a script, can be re-run with a new timestamp, reports status to ARM. Useful post-deployment or for Windows.
Both run as root, so never put secrets in them; pull secrets from Key Vault with the VM's managed identity.
More on Compute and App Platforms
What are the main VM families and how do you pick one?BeginnerAvailability sets vs availability zones vs VMSS flexible orchestration.IntermediateWhat is a Virtual Machine Scale Set and how does autoscale work?BeginnerWhat are VMSS upgrade policies?IntermediateWhat are Spot VMs and where do they fit?IntermediateWhat is the temporary disk on a VM and why does it matter?Beginner