简体   繁体   中英

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在此处输入图像描述

在此处输入图像描述

Refer Configure ports for more information

As mentioned in official MSDoc , if you still face after checking all the approaches, you can report the issue.

You can follow the GitHub link for further updates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM