Once the VMSS is up, I wanted to execute a shell script as part of the VMSS extension. This is what I tried but the script didn't execute.
My initial analysis is the script is not available to VMSS; in this case how to copy the script along with the tf build, I don't want to upload to blob storage and supply the path here. In case of VM I can achieve the same using file provisioner and remote-exec.
..................................
extension {
name = "StartupScript"
publisher = "Microsoft.OSTCExtensions"
type = "CustomScriptForLinux"
type_handler_version = "1.5"
settings = <<-SETTINGS
{
"commandToExecute": "${var.startup_command}",
#Script path from where my TF is running
"script": "${base64encode("/bin/sh ./path_to_custom_scripts/my_script.sh script_param")}",
"enableInternalDNSCheck": "false"
}
SETTINGS
}
..................................
Didn't find much info in extension.log, any help is highly appreciable.