After I studied your problem, I can offer a very simple solution, as shown below, which I made earlier for the Tomcat / Java example:
Prepare the EXE to reboot the virtual machine along with the source code :
- In your EXE, create a method to search for a specific XML file in Azure storage at a specific interval, also add retry logic to access the XML
- Parse the XML for a specific value, and if a specific value is specified, restart Machine
- Put your exe in zip format and put in your Azure Storage
- Be sure to put the XML in the Cloud and set the value of reboot = false
What to do in the Startup Task:
- Create a startup task and download the ZIP from Azure Storage, which contains the EXE
- After downloading, unzip the file and place the EXE in a specific folder
- run exe
What to do if you want to update the EXE:
- Update your EXE package in ZIP and place it in the same place in Azure Storage with the same name
- Update your XML to enable reload
How the update will happen:
- EXE will search for XML after certain internal
- After he installs the reboot, he will reboot the VM
- After rebooting, the launch task starts and your new EXE will be uploaded to Azure VM and updated. Make sure that downloads and updates are performed in the same folder.
Take a look at the Startup tak in the example below, which uses a similar method: http://tomcatazure.codeplex.com/
source share