So, you have some code running in a Windows Azure Worker role on Azure (not on the Azure Compute Emulator) and you need to debug what is going on. In this blog post I will show you how you can use Azure Connect, the remote desktop and the remote debugger to look inside your worker role.

WARNING: this process can be a strain on your patience, since the debugger will work very slowly! But this is the only way to look inside a running worker role using the debugger…

First we need to install the worker role in an Azure instance, not forgetting to enable remote desktop and Azure Connect.

To install Azure Connect, right-click on the worker role and select Properties. The Worker Role configuration window will open. Select the Virtual Network tab:

Check the “Activate Windows Azure Connect” checkbox and copy-paste your activation token in the textbox. To get the activation token, go to the Windows Azure Portal, select the Virtual Network tab and select your subscription (you may need to request access to Windows Azure Connect because it is still in CTP).

Click on the Get Activation Token button:

Copy the activation token and paste in the project’s properties.

If you have never done so before, click on the Install Local Endpoint button to get the local software installed on your computer.

To install Remove Desktop, you need to first install a certificate on your Hosted Service, containing both private and public key pairs. This is easy to do using Visual Studio: