Is it possible to edit cloud-init?

Ruan Nagel 0 Reputation points
2025-02-14T10:26:59.1+00:00

I cannot find any documentation on changing the cloud-init for VMSS. Is it possible to do this? And if so, is it possible to do this through Azure Portal or does this have to be done through Azure CLI? I need to have a script that runs each time a VM is provisioned to download and install docker, then it should pull a docker image and run it.

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
431 questions
{count} votes

1 answer

Sort by: Most helpful
  1. TP 104.5K Reputation points
    2025-02-15T17:31:23.17+00:00

    Hi,

    Yes, you can use Custom data or User data with VM Scale Sets. To "edit" it you need to replace the existing Custom/User data with new version.

    For example, you may navigate to your VMSS in the portal and click Settings -- Operating system blade. In screenshot below you can see I'm setting Custom data to a Bash script, which cloud-init will run when VM instance is provisioned:

    cloud-init custom data bash script

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.