For various reasons you may have difficulty attaching your debugger to an Azure Web App. This quick blog will show you a method that may work for you if you get into this situation. I will NOT attempt to diagnose your issue in this blog so please don’t post a question asking why the normal methods don’t work for you (like right clicking your resource in Server Explorer of Visual Studio).
Step 1. From the main menu, click on the Debug menu item and select Attach to Process …
Type in the URL of your Azure Web App and add the :4020 port (default debugging port) then hit enter and a credential dialog will appear:
For the User name and Password you can download the Publish Profile and extract it from there:
Look for “userName” and “userPWD” in that file. Note when you enter the user name you will need to also include the domain. For example: if the username is ‘$constowebapp’ when you enter it in the credential dialog it should be entered like this ‘$contosowebapp\$contosowebapp’.
Now that you are authenticated choose the w3wp.exe process (Standard .NET app):
For a .NET core app you will want to ensure you choose Managed(v4.6, v4.5, v4.0) code and then the name of the Core app (not w3wp.exe):
I know this was a quick and dirty blog but let me know if this helped you out. Again… My intent is not to troubleshoot your connection issues (firewall could be in the way, invalid or outdated publish profile could be associated with your app… The list goes on and on) but to get you unblocked so you can debug!