Search code examples
azureazure-virtual-machinerhel

Azure VM RHEL Custom Script Extension: script.sh not found error


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


Solution

  • I did the test follow the steps you posted. And it works well in my side. The result here:

    script.sh

    enter image description here

    customExtension

    enter image description here

    execute in the vm:

    enter image description here

    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.