Introduction

This article walks you through the steps for remote debug your application on Microsoft Azure. This new feature only works on Visual Studio 2013 with Microsoft Azure SDK 2.2 or higher.

 

STEP 1 - Install Microsoft Azure SDK for .NET

This could be done through Microsoft Web Platform Installer

Select the option Add on item Azure SDK for .NET (VS 2013) -2.2, and the component will be installed on your machine.

STEP 2 - Create Azure Account

You need to get a Windows Azure account. Everyone can open a Windows Azure trial account for free for 30 days. 

Check the link below for more information.

http://www.windowsazure.com/en-us/pricing/free-trial/

STEP 3 - Create Microsoft Azure Cloud Service

Create a new project on existent solution of type Windows Azure Cloud Service, using the template that is shown on the next image. I call to this project CloudServiceRemoteDebug.

  

After select the OK button, a new screen will appear to the user. In this sample, we want to create a ASP.NET Web Role,  so select this option, and give it a name.

  

Press the OK button. After this we need to select on the next screen the type of application. In this demo, we will use MVC as a template. So select this option.

  

STEP 4 - Deploy to Azure activating Remote Debug

In Visual Studio select Solution Explorer and right-click the option "Publish" on the Cloud Service Project. On this dialog, we need to make sure that the application will be built in debug mode, to ensure that we can use the remote debugger.

  

          

After selecting the option Publish, a new dialog will appear, with several options to configure.

The first one is the selection of your subscription.

  

 

After that, when we press the next button, we will need to select our cloud service. Because this is a new one of our subscription, we need to create it. There exist two options to do that. One through this dialog, and the other one through the Microsoft Azure Management Portal, where we can manage our subscription.

 

In this demo, we will create it through the Publish Settings Dialog. So give it a name, and select the region.

 

Select the option Debug on Build Configuration setting. Only that way, we will be able to debug remotely our application.

 

 

Selected Advanced Settings tab, make sure we checked "Enable Remote Debugger for all roles". In WACS, a cloud service could be able to have one or more roles and each role could be able to have one or more instances. The remote debugger will be enabled for all roles and all instances if we checked. Currently there's no way for us to specify which role(s) and which instance(s) to enable.

  

Finally, click the "publish" button.

 

  

To attach remote process, open Server Explorer Window in Visual Studio and expand Cloud Services node. Find the cloud service, role and instance we had just published, right click on the instance and select the option Attach Debugger.

  

 

Now, if we put a breakpoint inside our code, the debugger  will stop there.

Windows Azure Resources

Some good resources about Windows Azure could be found here: