none
Issue integarting App Insights with AzureDevOps RRS feed

  • Question

  • Hi guys,

    I was attempting to setup the Application Insights integration with Azure DevOps for Work Items, to be able to easily log issues in our backlog, appearing on an application that is about to go live.

    In the portal, on my Application Insights instance, under Wrok items, once the form was filled with the right information, and authorised successfully, on submission, the following error pops up ( with no error code preceeding it, or any other similar identification properties ):

    Method not found: 'Void Newtonsoft.Json.Serialization.JsonDictionaryContract.set_PropertyNameResolver(System.Func`2)'.

    Any ideas on how to get this working, or what might be causing this, would be much appreciated, as I would like to get this feature working on this project.

    Many thanks,

    Vlad

    Thursday, May 9, 2019 2:26 PM

Answers

  • Hey Brady,

    I am the developer for the Work Items integration in Application Insights. Korey contacted me on this and we were able to find the root cause.

    In short, we had an assembly conflict when using a newer version of the JSON parser with the older DevOps libraries. The full story is below the error message.

    I have a change in our pre-production environment that I tested today which looks to work as expected. It should be in production by the end of this week, hopefully sooner.

    Now, instead of a message like the one above you'll see something like this below. This is the direct error message from Azure DevOps. Mind you this used to work prior to Feb of this year. The full story explains what happened.

    TFS Error

    The full reason for this is because between versions 8 and 10 of Newtonsoft they removed the property listed in the error message you posted here. Unfortunately we have a shared components that was upgraded earlier in the year that required a later version of Newtonsoft (10.0.3 to be exact). However, the DevOps library required this method to deserialize the message. The DevOps library only has a requirement of >=8.0.1 so there was no enforcement/check until runtime.

    Lastly, in our code we use the async methods to create the work item. If there is a problem we simply capture the "AggregateException" type (as well as some other specific exception types) and output the message of the InnerExceptions. We don't check the type of the InnerException. Since the change the only inner exception we got was the Method not found that is what would be output.

    The first iteration of the fix will correct the libraries. The second iteration of the fix will make sure we return either a message from DevOps or a message indicating that we don't expect this and it's a problem with the service.

    Please note that due to a number of constraints we can only go to version 15.112.1 which is still a few years old but we're locked to this until we can upgrade other components like the Jwt tokens class that is used by our shared components 


    Monday, November 18, 2019 8:26 PM

All replies

  • Vlad,

    We've seen reports similar to yours.  Did you build for .NET 4.6? 4.6 is not automatically supported in Azure Cloud Services roles. Install 4.6 on each role before running your app.

    https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-troubleshoot-no-data#exception-method-not-found-on-running-in-azure-cloud-services



    Tuesday, May 14, 2019 12:23 AM
    Moderator
  • Hi there,

    Unfortunately I think maybe my issues was misunderstood. I don't have any problems getting telemetry from my application to App Insights, nor do I have any problems with my application.

    My issue is in enabling the Work Items feature on the application insights instance, in the Azure Portal, to be able to create work items from telemetry, directly from the Azure Portal ( I am talking about this feature: https://azure.microsoft.com/en-gb/blog/application-insights-work-item-integration-with-visual-studio-team-services/ ).

    I hope this makes it a bit clearer.

    EDIT:

    Tuesday, May 14, 2019 8:33 AM
  • Vlad,

    The best guidance I can recommend right now is the Work Items blog by Mike Gresley (Senior Program Manager for Application Insights).  I have run into the Authorization issue and am continuing to investigate this.

    Thursday, May 16, 2019 1:49 AM
    Moderator
  • Yep, I've cross-checked that I have followed the documented steps of doing it, but no joy.

    I have done it in the past for other projects, so it came as a bit of surprise when I haven't managed to get it working now, as I don't seem to have done anything differently

    Tuesday, May 21, 2019 11:54 AM
  • Vlad,

    This ended up being my reproduction steps.  Let me know how they compare to your steps:

    1. In Azure DevOps, click on + Create project in the upper right
    2. Give the project a name
    3. Click on Advanced, and select a Work item process (I selected Agile)
      Note: Basic will be selected by default, and it is the only option that does not support the "Bug" type which we will need to complete the Application Insights setup.
    4. Copy the URL from DevOps (in this case, mine was https://dev.azure.com/kobulloc-appins-workitem/AppIns-WorkItemTest-Agile)
    5. Navigate to your Application Insights resource in the Portal, and select Work Items
    6. For URL, use everything but the project name you just created (see below)
    7. For Project, use the project name you just created
    8. For Area, I used the project name again
    9. Click on Authorize
      Note:  There are two bugs here which we are working to resolve which have workarounds:
      a)  Here I got a popup that wouldn't close, but the url ended with "=Valid".  I closed the popup manually.
      b)  Clicking OK the first time around resulted in the error "Please setup authorization to tracking system".  I switched tabs (clicked on Alerts), then switched back to Work Items.
    10. Click on OK

    Monday, June 10, 2019 5:34 AM
    Moderator
  • Apologies for the late response, as I have kind of given up on setting this feature up for that project. I will give it another try as soons as I can, and will update my response accordingly. I have managed to set this up just fine for other projects though, which is why I found this issue a bit weird. 

    3rd July Edit:

    I have given it another try for that particular project, and, I am getting the same result as previously:

    One or more errors occurred. Method not found: 'Void Newtonsoft.Json.Serialization.JsonDictionaryContract.set_PropertyNameResolver(System.Func`2)'.

    Just no luck with it. This is the only bug I am running into tho, haven't had problems with the authorization or pop-ups.



    Wednesday, June 26, 2019 11:28 AM
  • I am experiencing the same exact issue.

    

    Wednesday, July 17, 2019 10:07 PM
  • I want to give an update here:

    • The issue has been brought to the attention of the product group
    • It's been triaged, and they are looking into it
    • While I'd love to report an immediate solution, more likely we're about a month out
    • We'll update the thread as there are more details

     

    Thank you so much for your patience, and please report any additional information you have here.



    Monday, July 29, 2019 4:42 PM
    Moderator
  • We're having the same issue and I see we are due an update by now?
    Tuesday, October 8, 2019 10:29 AM
  • I'm following up with the product group for an update.  Just to clarify, you are seeing the "Method not found" error?
    Wednesday, October 9, 2019 4:07 PM
    Moderator
  • I am getting the same error. After looking into my browsers network log I was exposed to a more specific error which I pasted below.

    code: null
    innererror:
      diagnosticcontext: "3c957082-23ae-4e58-8c54-9eee3c32cd43"
      time: "2019-10-10T18:35:30.9787852Z"
    message: "One or more errors occurred. ↵Method not found: 'Void Newtonsoft.Json.Serialization.JsonDictionaryContract.set_PropertyNameResolver(System.Func`2<System.String,System.String>)'."


    • Edited by Brady Liles - A3 Thursday, October 10, 2019 6:41 PM Weird formatting issues.
    Thursday, October 10, 2019 6:40 PM
  • First of all, thank you very much for your patience as we track down the root cause of what you are seeing.  I had a chance to speak with the developer that is working on this feature and they are working hard to get these issues addressed.

    There are two scenarios that seem to be impacting people:

    1. "One or more errors occurred.  Method not found: ..."
    2. Validation errors when attempting to authorize using the portal

     

    One or more errors occurred.  Method not found: ...

    This error is most likely trying to report an incorrect parameter, template, or setting. There was a breaking change in the errors received from DevOps when they updated their infrastructure earlier in the year.  A fix is being worked on and in the near future you should receive more informative errors (example: "Area path is incorrect").

    In addition to typos in parameters and issues with premade templates, be sure to check the following:

    • Make sure that "Work item process" is set to something other than "Basic", as Basic does not support the bug type.
    • If you created an inherited process, double check and edit your settings (in DevOps, click on Azure DevOps in the upper left to get back to the landing page > Click on Organization settings in the lower left > Under Boards, click on Process > Click on All processes at the top if need be > Click on ... next to your process > Click on Create inherited process)

     

      

      

    Validation errors when attempting to authorize using the portal

    There are a couple scenarios to be on the lookout for when attempting to verify in the portal:

    • If authorize = success at the end of the pop up window, you can close the window manually (it will not currently close on its own).  Click OK at the bottom and get a validation error.  At this point you will need to toggle the Advanced Configuration on and off.  Click OK at the bottom and you should be successful.  If you attempt again, it will error as you have already successfully authenticated.
    • If an error was made when filling in the parameters, it's possible for the work item to get into a bad state and reject future correct parameters.  In this case, delete the work item and start over (Application Insights resource > Configure / Work Items > "Delete" at the top).

     

     

     

    Thursday, November 7, 2019 3:57 AM
    Moderator
  • Hey Brady,

    I am the developer for the Work Items integration in Application Insights. Korey contacted me on this and we were able to find the root cause.

    In short, we had an assembly conflict when using a newer version of the JSON parser with the older DevOps libraries. The full story is below the error message.

    I have a change in our pre-production environment that I tested today which looks to work as expected. It should be in production by the end of this week, hopefully sooner.

    Now, instead of a message like the one above you'll see something like this below. This is the direct error message from Azure DevOps. Mind you this used to work prior to Feb of this year. The full story explains what happened.

    TFS Error

    The full reason for this is because between versions 8 and 10 of Newtonsoft they removed the property listed in the error message you posted here. Unfortunately we have a shared components that was upgraded earlier in the year that required a later version of Newtonsoft (10.0.3 to be exact). However, the DevOps library required this method to deserialize the message. The DevOps library only has a requirement of >=8.0.1 so there was no enforcement/check until runtime.

    Lastly, in our code we use the async methods to create the work item. If there is a problem we simply capture the "AggregateException" type (as well as some other specific exception types) and output the message of the InnerExceptions. We don't check the type of the InnerException. Since the change the only inner exception we got was the Method not found that is what would be output.

    The first iteration of the fix will correct the libraries. The second iteration of the fix will make sure we return either a message from DevOps or a message indicating that we don't expect this and it's a problem with the service.

    Please note that due to a number of constraints we can only go to version 15.112.1 which is still a few years old but we're locked to this until we can upgrade other components like the Jwt tokens class that is used by our shared components 


    Monday, November 18, 2019 8:26 PM
  • Hey guys,

    Thank you very much for everyone's contribution to identifying, diagnosing, and solving this issue.

    I will mark the above reply as an answer, and looking forward to seeing the fix in production.

    Cheers,

    Vlad

    Tuesday, November 19, 2019 11:47 AM