I am trying to execute multiple shell scripts by separating each command using \'&&\' using Azure Custom Extension script for Linux.
ARM templates is the deploy
ARM template Snippet
cmdToExecute = script1.sh param1 param2 && script2.sh param1 param2 && script3.sh is passed as a string to a wrapper script like
"commandToExecute" : "[concat('sh script_executor.sh \"', parameters('cmdToExecute') '\"')]"
script_executor.sh -- takes all commands as parameters and executes each command
If you have multiple scripts, you can author an entry point script that calls the dependent scripts, then upload the entry point script, dependent scripts and any other dependent binaries to the script location(Azure storage blob or GitHub). You can use following format to ensure multiple files are uploaded: “fileUris” : [“ScriptFileUri1”, “ScriptFileUri2”, "ScriptFileUri3"]
More information please refer to this link.
If you want to set script1.sh as the entry point script, you could edit you script such as below:
##script in scrpit1.sh
echo "hello world"
##call script2.sh
./script2.sh
##call script3.sh
./script3.sh