anonymous user , Thank you for your question.
cloud-init configures a virtual machine (VM) or virtual machine scale sets at provisioning time in Azure. These cloud-init configurations are run on first boot once the resources have been provisioned by Azure. [Reference]
Please see Cloud-int boot stages (processing configuration) for more information.
Once the Azure Linux VM agent is installed and the VM is running, then CustomScript uses the following algorithm to run a script:
- assert the length of the script's value does not exceed 256 KB.
- base64 decode the script's value
- attempt to gunzip the base64 decoded value
- write the decoded (and optionally decompressed) value to disk (/var/lib/waagent/custom-script/#/script.sh)
- execute the script using _/bin/sh -c /var/lib/waagent/custom-script/#/script.sh.
----------
Hope this helps!
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.