It would be nice to see the documentation to run a full .sh file on the machine instead of putting the commands in string format of the json.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@amittleider Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.
@amittleider - I will work on having a sample published.
In the interim, the Custom Script Extension overview doc has a sample that completes what you are asking for.
Does this help?
Thanks
Yes. The sample online right now works, but the custom script source line
of my file is not readable. In a normal .sh file it would be about 20 lines.
Thanks for your quick response.
-Andrew
On Sun, Apr 15, 2018, 23:35 Neil Peterson notifications@github.com wrote:
@amittleider https://github.com/amittleider - I will work on having a
sample published.In the interim, the Custom Script Extension overview doc
https://docs.microsoft.com/en-us/azure/virtual-machines/linux/extensions-customscript#azure-cli
has a sample that completes what you are asking for.Does this help?
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/MicrosoftDocs/azure-docs/issues/7204#issuecomment-381439877,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABjPXwXv44fNORTtyl3Ooe18QTlcalI1ks5to70YgaJpZM4TVkXc
.
Can you clarify this:
the custom script source line of my file is not readable. In a normal .sh file it would be about 20 lines.
Using the example found here, you should be able to store your script (.sh file) in an accessible location, GitHub, and then run the script .via the script extension like this, where
Most helpful comment
When I say that the source is not readable, I mean that I have a script that is roughly 40 lines, and writing the entire thing in the text body is not really a great solution.
Giving the script URL as you proposed is great. However, it has inspired me to another solution -- to simply base64 encode the script as JSON, and execute it on the other side. You can find the example here: https://github.com/amittleider/azure-vm-with-custom-script
Kind regards,
Andrew