I've been trying to deploy a custom script extension to a RHEL VM in Azure. The script just contains 'mkdir testfolder'. And 'command to execute' is 'sh script.sh'. I keep getting an error 'script.sh can not be found'.
How do I properly execute custom script Extension in RHEL Azure VM?
On the menu blade of a RHEL azure vm, selected extensions, then chose custom script extensions from the list of extensions, then uploaded the shell script file(script.sh), and in command to execute: sh script.sh
I did the test follow the steps you posted. And it works well in my side. The result here:
script.sh
customExtension
execute in the vm:
So you should check if your script name is same as the command sh script.sh
. The error "script.sh can not be found" just shows the reason.