In this video, we explore configuring the VMSS Agent Pools with required software to run your build pipeline using cloud-init.

Here is the cloud-init YAML I’ve used to configure the VMSS:

package_update: true
package_upgrade: true
  - apt-transport-https
  - ca-certificates
  - curl
  #Installing Azure Cli
  - 'curl -sL | bash'
  #Configuring docker permissions
  - 'chmod 777 /var/run/docker.sock'
  #Installing kubernetes-cli
  - 'curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg'
  - 'echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list'
  - 'curl -s | sudo apt-key add -'
  - 'apt update'
  - 'apt install -y kubectl'
  #Installing Helm
  - 'curl -sL | bash'
final_message: "The system is finally up, after $UPTIME seconds"

Note: Be sure to keep the cloud-init file short and quick to execute so that the agent pool doesn’t start dispatching jobs to it before the configuration is complete.

You can learn more about cloud-init from here.

Enjoy :)