0

I am attempting to attach the debugger to an Azure App Service Web API. I'm using Visual Studio 2015 Update 3 with Azure SDK 2.9.5. The Web API is an ASP.NETCore 1.0.1 app targeting full framework. enter image description here

Steve W.
  • 413
  • 1
  • 5
  • 12
  • lemme find someone here who can help... – bmoore-msft Oct 11 '16 at 22:55
  • Great. Thanks for the help! – Steve W. Oct 11 '16 at 22:58
  • How did you attach debugging your app, under the App Service node of Server explorer window or the Attach to process window under Debug menu? Whether your code use the Threading components? http://stackoverflow.com/questions/2657212/the-calling-thread-must-be-sta-because-many-ui-components-require-this-error – Jack Zhai Oct 12 '16 at 02:19
  • I attached the debugger using the server explorer. Threading components? What threading component are you referring too? – Steve W. Oct 13 '16 at 01:40

1 Answers1

1

Unfortunately, this is a bug with how the current tools for Azure App Services (in Azure SDK 2.9.5) call in to the debugger. We've prepared the fix for this and it'll be included in the next Azure SDK release.

For the time being, you can still attach the debugger to the site by using the Attach to Process... method.

First, make sure remote debugging is enabled on your site for the version of VS you're running by visiting portal.azure.com, browsing to the site, clicking on Application Settings in the flyout, turning the Remote debugging setting to On, setting Remote Visual Studio version appropriately and clicking Save at the top of the blade.

enter image description here

Returning to VS, click Attach to Process... on the Debug menu.

Attach to process on the debug menu

On the dialog that pops up, enter the address of your site and port 4020

Attach to process dialog

If prompted for credentials, you can get them by visiting portal.azure.com, browsing to the site in question and clicking the Get publish profile button.

enter image description here

This will start the download of a .pubsettings XML file. In this file, there are two <publishProfile> tags - on the one with publishMethod="FTP" the values for userName and userPWD contain the username and password values you'll need.

After you're authenticated, you should see the list of processes running on the site. Generally, you'll want to attach to w3wp.exe (or dotnet.exe if you're running a .NET Core app).

mlorbetske
  • 5,529
  • 2
  • 28
  • 40
  • For some reason, it's failing to authenticate. I made sure I selected the correct profile, cut & paste the username and userPWD fields, but it just keeps saying "Authentication failed". – Steve W. Oct 20 '16 at 13:58
  • @SteveW. I just ran through this to make sure it worked with a site & noticed that you'll actually need the `FTP` credentials instead of the `MSDeploy` ones. I've updated the answer accordingly. The other time where I ran in to the repetitive Authentication Failed message was when I didn't have the remote debugging settings configured appropriately (location of them is in the first screenshot in my answer, the first button should be `On` and the second should match your VS version). Sorry for the delay. – mlorbetske Oct 23 '16 at 08:15