Visual Studio 2022 Debug On Remote Azure Server - azure-web-app-service

I appears that the Cloud Explorer has now been retired in Visual Studio 2022.
This was something that I used many time a day and will sorely be missed.
I used to be able in the Cloud Explorer select the app service, right click, and attach the debugger to the app. In Visual Studio 2022 I can find no way of attaching the debugger the the remote Azure app service. Also browsing the web I can't find any documentation on how to do this. Can someone supply directions on how to do this, or point me to the documentation on how to debug an Azure app on the remote server.

Currently there's an option to debug Azure App Service.
Instead of using the cloud explorer you may create a publish profile and attach a debugger from there:
All in VS 2022.

I’ve had the same problem, trying to do remote debug an App Service with VS2022. I just realised that the top dropdown box “Connection Type” on Debug | Attach to Process... dialog gives you an option “Microsoft Azure App Services” (I'm using ver 17.2.4). Clicking the Find button lets you select target App Service. You can then select the target process. (Attaching from the Publish dialog doesn’t let you select the process - you may have a number of apps on virtual directories).
One thing I noticed and confusing; the listening port is not 4026 but 4024 even though you specify VS2022 on the Azure Portal in my case. Telnet or Psping to 4026 – no response. If you do the above way, this doesn’t matter but if you select Connection Type: “Default” and specify host:port, then the port should be 4024. You can remotely debug Azure Function in this way.

Today with Visual Studio 2022 you can use the Connected Services node under a given project:
Once you connect to an app service, you'll have access to attach the debugger:
Microsoft Learn Module
Remotely debug ASP.NET Core apps hosted on Azure App Service using Visual Studio
More info here:
Manage the resources associated with your Azure accounts in Visual Studio Cloud Explorer
Overview: Connected Service

Related

Unable to attach to Azure App Service from Visual Studio 2019 Community edition

I have an Azure App Service which hosts my Web Api solution. Sometimes, when there's a production issue which can not be reproduced on local environment, I usually attach a Visual Studio 2019 (community edition) debugger to that live instance.
For some reason, now it has stopped. When I try to attach the debugger by making a reference to Cloud Explorer > Pay As You Go > App Services > my-app-service (right-click and Attach Debugger) I get the following error:
System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named '************************.azurewebsites.net'. The connection with the remote endpoint was terminated.
at Microsoft.WebTools.Azure.VS.Operations.IDebuggerInternal120.ConnectToServer(String szServerName, VsDebugRemoteConnectOptions[] pConnectOptions, CONNECT_REASON ConnectReason, Int32 fIncrementUsageCount, IDebugCoreServer3& ppServer)
at Microsoft.WebTools.Azure.VS.Operations.RemoteDiagnosticsSessionBase`1.ConnectToServer(String site, String user, String password)
I have no idea why is that. Tried to logout/login from my Azure account, also tried to restart the app service oh Azure but still nothing. Also tried to re-deploy the app but again nothing.
I have tried to remote debug the Azure App service from VS 2019 Community Edition, got the same error.
Tried the below approaches:
Approach 1:
In Visual Studio => View => Cloud Explorer => Select your App Service => Right click and Attach Debugger.
Got the below error.
Approach 2:
In VS => Debug tab => Attach to process.
In Connection target enter the deployed URL name without https
Ex: YourWebAppName.azurewebsites.net
It asks to enter the credentials. In Deployed Azure Web App=> click on Get Publish profile, there you will find the username name and password.
Error :
Approach 3:
In Publish window => Hosting => Attach Debugger
Reference Link
If you still face issue after checking all the approaches, you can report the issue.
You can follow the GitHub link for further updates.

Unable to attach debugger from VS 2017 to Azure App Service for Web App Bot

I have deployed my Bot Framework v4 app as a Web App Bot to Azure. I can connect to it in Web Chat in the Azure Portal, but it is crashing when I message it via Twilio.
I am attempting to debug this, but when I try to attach via Visual Studio's Cloud Explorer I get the error in the screenshot. I have also tried attaching directly by using the username and password in my publish profile, but that always results in the breakpoints saying the symbols haven't been loaded once it is connected. When I look at the debug modules, I don't see any pertaining to my bot's dll. This is with the publish profile set to the Debug configuration, so no issue with optimized code.
Any suggestions are greatly appreciated!
I have seen this error during one of my attempts. I ended up removing the current version of code from the web app by using the Kudu Console, restarting the app service and then publish again from VS using the publish profile.
Was able to make some progress on debugging by attaching to SITENAME.scm.azurewebsites.net instead of SITENAME.azurewebsites.net.
Doesn't explain why Cloud Explorer still can't connect, but at least unblocks me for now

Attach debugger to ASMX service on Azure app service

I have an old service that we have deployed up into Azure using an App Service (type: Web App). I publish this asmx direct from Visual Studio 2015 Professional. It works really well accept I cannot attach the VS 2015 Pro debugger to an instance of my ASMX.
I have set everything up correctly (so I think) in Azure and I am deploying with a Debug configuration:
But when I attach the debugger from VS - no errors are shown, it appears successful up until I set a new breakpoint, I get this (I have confirmed that I am attached to w3wp.exe):
I get a "hollow" breakpoint and the error:
The breakpoint will not currently be hit. No symbols have been loaded
for this document.
I get what this error is, what I don't get is how can I successfully attach the debugger to an ASMX service on azure?
Is attaching a debugger to ASMX on azure not supported?
Figured it out. Despite everything looking like it was attached, it wasn't. I had to go to Debug > Attach to Process > and specify the website.
Using the remote debugging option on both Cloud Explorer and Server Explorer does not work in my scenario.
For a better walk through:
https://msdn.microsoft.com/en-us/library/dd434211(v=vs.100).aspx
The real issue:
Azure does not play nice with < .net 4
After upgrading the package to 4.5.2 I could do the following:
Attach the debugger from VS
Use the ConfigurationManager class to get application settings and connections strings from Azure
Plus a few other basic Azure features.
Bottom-line, update .net before publishing

Missing azure mobile services support in visual studio express 2013

I´m currently trying to set up an azure mobile service .net backend for an app. I´m using visual studio express 2013 for Windows / for Web. I installed all available updates and the recent azure sdk (2.4).
My problem now is that there is no "Azure Mobile Service" project template and mobile services is even not displayed beneath the azure entry in the server explorer.
What did I miss to install?
Many thanks in advance!
UPDATE:
I tried to set up the mobile service with visual studio express 2012 but I stuck at the same problem. Neither the mobile service template nor the option in the server explorer is present.
I just downloaded Visual Studio 2013 Express for Windows with Update 3 from this link:
http://www.microsoft.com/en-us/download/details.aspx?id=43729
I then had the mobile services node in the Server Explorer. However, the project template still isn't there.
This was with Azure SDK 2.3 already installed and also tested with Azure SDK 2.4.
The project templates ship with Visual Studio SKUs and their updates, and I believe Mobile Services is only shipping with Pro and Ultimate for now.
One option to get that starting project is to provision your mobile service in the portal making sure to select the .NET backend. Then on the quickstart page of the portal (the little cloud to the left of the dashboard tab) select the link to create a new application. You will get an option to download the starter solution for the .NET backend (for windows apps it will also download the client). That is basically the same project you would get by choosing File -> New Project in VS pro or ultimate. You can then open the solution in VS Express for Web 2013 but not VS Express for Windows.
To publish the mobile service you'll need to do the following:
Go back to the portal and on the Dashboard page for your mobile service click the Download Publish Profile link and save to your local machine
Right-click the project in the Solution Explorer and choose "Publish"
Import the publish profile you downloaded in step #1 and finish the publish process
So if you want to use the express versions of VS 2013, make sure you have all the updates then:
Use VS 2013 For Windows to manage your mobile service in server explorer and build your windows clients
Use VS 2013 For Web to build your Azure Mobile Service back end project, run locally, and publish using the publish profile.

Hook up visual studio profiler to Azure Service Instance

i am not sure if this is the correct place to put of this question as this has nothing to do with coding but rather configuration. My apologies.
I want to hook up my visual studio 2012 profiler to a azure service WaWorkerHost.exe which is hosted on Windows Azure.
After much searching i found Profiling Cloud Service. But this shows only how to profile WaWorkerHost.exe which is currently running on localhost i.e. on Azure Simulator rather than on actual Cloud.
Any help will be appreciated.
Thank you
Not sure if this is something you're looking for, but you can enable profiling when you publish your cloud service through Visual Studio.
and here's a link which talks more about it: http://msdn.microsoft.com/library/hh369930.aspx.

Resources