Script failures are mentioned in this documentation.
How does the Custom Script Extension infrastructure know whether my script succeeded or not? Is it based on exit codes?
When it fails (and possibly when it succeeds), is the failure reason propagated anywhere? If so, from where? Does it look at the stdout/stderr of my script?
Thanks!
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the question! We are investigating and will update you shortly.
@yotauber The command we give in "commandToExecute" is executed in command prompt. I tried couple of scenarios.
We can find logs in the default path "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension1.9.2\Status"
Please let me know your comments.
@yotauber to add to @jakaruna-MSFT response, if you deploy a custom script it is added to the Extensions section in the Azure Portal. You can select that custom script and find additional details about the failure or succession. It should be similar to what you find in the "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension1.9.2\Status" without the need to actually login to the VM.
Worked offline with the user.
User don't have access to the VM or Portal. User have access only to run ARM templates. User wanted to get the custom script output while executing the ARM templates. Right now, Custom script extension output can be found from the portal or from the VM. ARM template will show only the script passed or failed.
Closing this issue for now. Please reopen if further details are needed.
Most helpful comment
@yotauber to add to @jakaruna-MSFT response, if you deploy a custom script it is added to the Extensions section in the Azure Portal. You can select that custom script and find additional details about the failure or succession. It should be similar to what you find in the "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension1.9.2\Status" without the need to actually login to the VM.