Your official information source from the .NET Web Development and Tools group at Microsoft.
In the Azure SDK 2.2 we released remote debugging support for Windows Azure Cloud Services. You can read more about that release at Scott Guthrie’s blog post Windows Azure: Announcing release of Windows Azure SDK 2.2 (with lots of goodies). You can find more info on Windows Azure Web Sites diagnostics and debugging at our docs for Web Sites diagnostics and debugging as well.
When we released the Azure SDK 2.2 the server side support for remote debugging Windows Azure Web Sites was not yet in production. Because of this the command was not shown in Visual Studio. We have now published the server side support in Windows Azure Web Sites, and the feature is now automatically enabled in Visual Studio.
In this post you will find the download links required to try out the new features as well as more info about the support.
In order to remotely debug your site you will need to download and install the following.
· Any version of Visual Studio 2013 which supports remote debugging
· Azure SDK 2.2
After installing the Azure SDK 2.2 you will now see a new menu option, Attach Debugger, for your Azure Web Sites. In the image below you’ll find this new menu option.
Now let’s see how you can use this new feature.
For a new site running in Windows Azure Web Site you’ll need to follow the following steps to get your remote debugging session started.
1. Publish your site to Windows Azure Web Sites
2. Invoke the Attach Debugger menu option in Server Explorer
To have the best debugging experience you should publish your site using the Debug build configuration. You can configure this for your publish profile on the Settings tab of the Web Publish dialog. The drop down is shown in the following image.
After publishing your application you can use the Server Explorer in Visual Studio to access your web sites. If you haven’t already you may need to sign in to Windows Azure in Visual Studio. You can do this using the Connect to Windows Azure button on the Server Explorer. See the image below for that button.
After signing in you will see your Web Sites under the Windows Azure node in Server Explorer. Right click on the site that you would like to debug and select Attach Debugger. When this is invoked the remote debugging agent will be started on your web site, you site is restarted with the agent attached, your default browser will be opened to the URL of your site, and Visual Studio will attach the remote debugger. The first time you do this the delay will be about 20 seconds, but subsequent usages will attach much quicker. If you disable the remote debugger option in the portal you’ll experience the ~20 second delay again.
After that you can debug your remote site as you would your local project. You can step through code, set breakpoints, break on exceptions, evaluate expressions, and all the other goodness you are used to.
Note: currently the support here is designed for single instance sites. If you attach to a web site running multiple instances, you will attach to a random instance. In the future we may look at providing a better experience here, but we do not have any specific plans yet.
For more info on remote debugging Windows Azure Web Sites you can visit http://www.windowsazure.com/en-us/develop/net/tutorials/troubleshoot-web-sites-in-visual-studio/#remotedebug.
You can also remotely debug your Windows Azure Web Site with Visual Studio 2012, but you’ll need to configure a few things manually for now. We are working to bring the same experience for remote debugging to Visual Studio 2012 but we are not there yet. For now you can use the steps below for Visual Studio 2012.
Please let us know what you think about this feature in the comments below.
Sayed Ibrahim Hashimi | http://msbuildbook.com | @SayedIHashimi
For me, same times show this error, and same times show the window "Windows Security" Enter your credentials.
I use VS2013, the published version in compiled in Debug mode.
Microsoft Visual Studio
Failed to enable remote debuggingException from HRESULT: 0x89710023
I'm with @Michael here, I get that error every time I try and connect the remote debugger.
Hi Michael & Aaron, sorry to hear that you are having issues.
How many characters are in your site name? We currently have a known issue that remote debugging only works for site names less than 20 characters. We are working on a fix but do not have it in production yet.
Sayed Ibrahim Hashimi
Only twelve characters in my website name and still the same error (VS2013 Premium on Windows 8 64-bit).
Any tips how to enable debugging when using Git deploy?
I also get 0x89710023 when trying to attach the debugger using Server Explorer in VS2013. Azure is set to allow remote debugging from VS2013.
Tried to use 'normal' attach to process using VS2012 instructions, and get this: "Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named aaaaa-bbbbb.azurewebsites.net. The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging." From VS2013, got the same result with Azure set to 2012 and 2013.
No symbols are being loaded, so the break point is never hitting. VS2013, Azure SDK 2.2. Trying from my local machine as well as a VS VM on Azure itself. Nada. Ideas?
@George I had the same problem and then I realized I had published in Release mode. try republishing using Debug. It worked for me.
@George Handlin Publishing in Debug mode works. :)
Sorry but is there any way to start remote debugging the second the project starts running, as "stepping into instance"? Cause I would like to analyze the startup behavior of my site after deployed to the cloud.
@Orfeo, debugging startup is not currently possible.
I've started a conversation with the appropriate groups so that we can investigate this. In the mean time if you are trying to debug your app start method you could think about putting a loop with a call to Thread.Sleep so that you can set your breakpoint and then continue debugging. I know that this is not an ideal workaround, but that is the best that I have for you at this time.
I also get 0x89710023 when trying to attach the debugger using Server Explorer in VS2013.
Do I have to open up more ports in the enterprise firewall?
I have the same error. Is there a fix ?
Very good, I will use a lot!
I opened up ports 4016 and 4018 in the firewall and things then worked fine.