none
Can not attach to remote debugger for azure function app RRS feed

  • Question

  • When I got to cloud explorer from VS 2019 and try to attach to my function I get the following error.

    System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named 'masterairport.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)<p>&nbsp;

    Iam not sure what I can do about this?

    Tuesday, October 15, 2019 6:08 PM

All replies

  • Hi Skip Snow LLC,

    Welcome to MSDN forum.

    According to your description, maybe this solution which is from the similar issue in Github, could help you:

       1. From the Portal, under the Overview tab,
          a. Download the publish profile for your Function App. Open the downloaded file and in its content, look for the credentials,
              i. userName
              ii. userPWD
          b. Copy the URL to your Function App

       2. From the Portal, under Application settings,
          a. Turn on Remote Debugging
          b. Select Remote Visual Studio Version as 2019

       3. From VS 2017 in the list of menu items, select Debug->Attach To Process

       4. In the Connection Target: text area, copy and paste the URL obtained from 1b followed by :4022 as that is the port for the remote debugger for VS2019, e.g. myFunctionSite.azurewebsites.net:4022

       5.You will be prompted for your credentials. Type in the username and password that you obtained from 1ai and 1aii. NOTE: For username it is preceded by .\ For instance if your username is "$myusername", key-in ".\$myusername"

       6.You should now see a list of processes that you can attach to. Select the one that has the process name w3wp.exe and click on the Attach button.

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com




    Wednesday, October 16, 2019 2:45 AM
  • Dylan:

    I trivially attempted to do the solution you proposed. It did not work. I will focus on this in the next couple of days and get back to you.

    I do want to ask which URL I attach to? Is it the function URL, and not the App URL. In the publish settings I find the "destinationAppUrl", but not the function URL. I can find the Function URL by going into the Azure portal. When I tried neither of the URLs worked. 

    Thanks 

    Skip

    Wednesday, October 16, 2019 4:20 PM
  • Hi Skip,

    Thank you for feedback.

    >>I do want to ask which URL I attach to? Is it the function URL, and not the App URL.

    The URL is PublishURL in the publishsettings file. But the port number need to be changed to 4022. please refer this image:

    Then press Enter key, it will automatically connect, and then type the user name and password, which is like bleow:

    Finally, please attach the w3wp.exe with specific username:

    Hope it could work and look forward to your feedback.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 17, 2019 8:30 AM
  • Hi Skip Snow LLC,

    Sorry for bothering you.

    After my latest reply, did it work for you? If no, please feel free to contact us, we will try our best to provide a solution for you.

    Look forward to your feedback.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, October 22, 2019 9:04 AM
  • Hi Dylan:

    It is still not working. I'm sure I must be doing something silly. I have spent a bit of time trying your solution. I've been debugging locally, and not had time to do it. So thanks so much for your patience.

    This image shows that I have remote debugging set to true;

    This image shows that I am publishing a debug version of the app

    This image shows that when I put the URL to attach to into my attach to remote process Remote Connection window that it can not find the process.

    I am thus not challenged for my user name or password.

    Thanks again for your help on this.

    With warm regards 

    Skip

     


    Yours

    Friday, October 25, 2019 6:37 PM
  • Hi skip,

    Thank you for feedback.

    The Url is not the site URL which is in your second image.

    Please go to Microsoft Azure Site, then go to "overview" of the project, click the Get Publish Profile to download "PublishSettings.txt" file.

    After that, please follow my previous reply, then you could attach to remote debugger.

    Look forward to your feedback.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, October 29, 2019 6:29 AM
  • Dylan:

    I've made progress. But still not been able to attach.

    There is no 'Site URL' in the profile, but I used the destinationAppUrl, and was challenged. I was also able to use the Publich URL to be challenged. But my credentials did not work.

    Below please find my Publish profile, with the password redacted.

    <publishData>
    <publishProfile profileName="MasterAirport20191021104039 - Web Deploy" publishMethod="MSDeploy" publishUrl="masterairport20191021104039.scm.azurewebsites.net:443" 
    msdeploySite="MasterAirport20191021104039" 
    userName="$MasterAirport20191021104039" 
    userPWD="Redacted" 
    destinationAppUrl="https://masterairport20191021104039.azurewebsites.net" 
    SQLServerDBConnectionString="" 
    mySQLDBConnectionString="" 
    hostingProviderForumLink="" 
    controlPanelLink="http://windows.azure.com" 
    webSystem="WebSites"><databases />
    </publishProfile></publishData>

    The user name is:

    $MasterAirport20191021104039

    The pwrd is redacted but I am copying and pasting it. I am still lost. 


    Yours

    Tuesday, October 29, 2019 7:31 PM
  • Hi Skip,

    Thank you for posting here.

    Please check the settings on my Azure, if you change some settings, please re-open "Attach to Process" dialog window then re-configure it:

    Look forward to your feedback.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, October 30, 2019 6:28 AM