Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Migration from V3 to V4 throws unexpected error message

Open tudor33sud opened this issue 2 years ago • 2 comments

Function App name: NodeJS Tools used: New V4 app or existing V3 app migrated to V4: V3 migrated to V4 + Node16

So, I migrated a function app V3 to V4 and upgraded my node version from 14 to 16. Everything seems to be working, however there's a misleading error message that it's getting thrown with the setup that I had on each request done to the function app.

I created a fully working playground where you could check the issue. Steps to run the demo:

  1. extract zip
  2. npm install
  3. add a valid app insights connection string inside local.settings.json
  4. npm start
  5. POST / GET request to localhost:7075/api/demo

Issue: each function app request will log this message image

My findings:

  1. If I remove application insights connection string and no client will be instantiated, function runs without the error message
  2. I suspect something inside app insights wrap with correlation context / app insights flush doesn't play well with Function App V4.

https://github.com/microsoft/ApplicationInsights-node.js#azure-functions code for context propagating http trigger was inspired from here

Sample code function-app-playground.zip

Let me know if you need any guidance, or if I'm doing something wrong within the project. The separation of func.ts and index.ts was purely to separate business logic from distributed tracing.

tudor33sud avatar Aug 05 '22 06:08 tudor33sud

Hi @tudor33sud Thanks for the feedback. We are investigating this issue further and will let you know about the findings. Thanks.

Ved2806 avatar Aug 08 '22 16:08 Ved2806

@Ved2806 is there any update on the issue? I am just checking to see whether it still needs triage or if it was forwarded to a team. Thanks a lot!

tudor33sud avatar Aug 16 '22 10:08 tudor33sud