How to manually change the role work files in the cloud by doing RDP?

Clicking a full cloud project on the cloud is very time consuming, so if there are some minor changes, and I want them to immediately reflect RDP as a web page and make these changes and restart IIS. Can something similar be done for a working role? I can RDP and replace the DLL files, but I do not know how to restart the working role, since it does not work in IIS. I'm not sure if the working role is working? I know that this is not a good practice, but since I am still at the development stage, this will greatly speed up my testing process.

Any easy ways to update a working role on the cloud, rather than a full push?

+8
c # iis azure azure-web-roles azure-worker-roles
source share
2 answers

Brent is 100% right, and I confirmed his answer. You must be careful not to make any changes through the RDP to the production service. Having said that, you mentioned that it was just for testing purposes at the development stage, and there is great value in updating a single DLL file and testing without moving the entire cloud service. I do this all the time when they fix problems on Azure VM.

Check http://blogs.msdn.com/b/kwill/archive/2011/05/05/windows-azure-role-architecture.aspx for the process architecture in the virtual machine. In particular, note that WaHostBootstrapper is the parent process for work and web roles. To replace the DLL with both roles on the network and in the workplace, the best way is:

  • Shut down WaHostBootstrapper. This can be done using the task manager.
  • Replace the dll. Note that you need to be quick when you do this, because Azure will automatically restart everything right after you kill WaHostBootstrapper *.
  • Wait for WaHostBootstrapper to automatically restart, and then WaWorkerHost / WaIISHost will automatically restart.

* If you need more time to make changes, you can connect a debugger, such as WinDBG, to WindowsAzureGuestAgent and leave it in this process. This will prevent Azure from restarting automatically from the host boot process. After making the changes, you can disconnect the debugger and continue running WindowsAzureGuestAgent. Note that if you leave WindowsAzureGuestAgent in a stopped state for more than 10 minutes, then the host agent will detect that the virtual machine is not responding and reboot the virtual machine.

* Edit: More detailed instructions are available at http://blogs.msdn.com/b/kwill/archive/2013/09/05/how-to-modify-a-running-azure-service.aspx .

+12
source share

Simply put, you will not do it. This is directly related to the "statelessness" of Windows Azure PaaS Cloud Services. If a role instance is to be moved, it will always revert to its original deployed state, discarding any changes you make. And role instances can be moved at any time. Thus, any attempt to RDP and make changes will cause your significant pain.

If you really need this type of dynamic deployment, you can create a launch script that pulls the content files from external storage (for example, Windows Azure Blob Storage) and pulls them into the role instance before running.

The worker itself is simply a long-term console program with an initial process initiated by calling the Windows Azure agent process in the guest virtual machine on the "OnStart" method of the role instance.

+6
source share

All Articles