I had a problem where I was updating cloud-init.txt for a VMSS deployment like https://github.com/KaiWalter/azure-private-link-port-forward/blob/main/infra/modules/forwarder/cloud-init.txt for while, but non of the updates seemed to be effective - although I was deleting and redeploying the VMSS.
Somehow an older version of cloud-init.txt was stuck in my deployment process which I was able to identify for a while.
How can I check on the running VMSS instance or on a VM which version is effective?
Connect to the VMSS instance or VM and check by extracting the value
<ns1:CustomData>from/var/lib/waagent/ovf-env.xml:based on this documentation https://learn.microsoft.com/en-us/azure/virtual-machines/custom-data#linux and this answer to extract from XML with sed