locked
Extensions in ARM template RRS feed

  • Question

  • Hi,

    I've a ubuntu VM (Canonial 15.05 from marketplace) in which I want to execute a small script whenever it's deployment from ARM template and then subsequently the script should execute whenever VM comes up if it's restarted or started later.

    I looked into Extensions a bit but couldn't find an example which is good enough for my requirement.

    THanks,

    /Saurabh

    Saturday, January 2, 2016 6:48 PM

Answers

  • I found the answer:

    https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-extensions-customscript-with-template/

    Tuesday, January 5, 2016 8:08 PM

All replies

  • Hi Saurabh,

    Is this VM a part of a VNET?
    If not, this query would be better addressed in Azure Virtual Machines Forum.
    You could however try Azure Automation to schedule VM starts or restarts.
    Or you could use PowerShell as in the following link:
    http://blogs.technet.com/b/parallel_universe_-_ms_tech_blog/archive/2013/12/16/stop-amp-start-your-vm-s-on-azure-with-powershell.aspx

    Regards,
    Malar.

    Sunday, January 3, 2016 10:47 AM
  • Yes. VM is part of VNET. All I want is that a bash script, lets say run.sh, should run whenever VM boots up. Since this script is not part of the Ubuntu Server 15.10 Canonical, it does not have the script.

    I'm currently manually copying run.sh script and then running it whenever it boots-up.

    Also, we will only use ARM template. We don't want to use Powershell or Azure CLI since it's part of automation.

    Thanks,

    Saurabh

    Monday, January 4, 2016 9:13 PM
  • I found the answer:

    https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-extensions-customscript-with-template/

    Tuesday, January 5, 2016 8:08 PM