Node 18: Azure Functions not happy, but it can be
TL;DR When you upgrade to node 18 you will find that azure functions can no longer be debugged, you need to update azure-functions-core-tools to at least version 4.0.4915.
This is a follow on from This is why development estimates are hard: Unexpected resolution in the DNS area, we have updated to using node 18 and its having a few unexpected results.
We test Azure Functions locally before deploying so when I started up the emulator I got:
[2023–05–23T16:16:12.659Z] A host error has occurred during startup operation ‘875d27c9–1cf1–496f-ba94-c86976147c62’.
[2023–05–23T16:16:12.661Z] Microsoft.Azure.WebJobs.Extensions.Storage.Blobs: Could not load type ‘Microsoft.Azure.WebJobs.ParameterBindingData’ from assembly ‘Microsoft.Azure.WebJobs, Version=3.0.34.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.
Value cannot be null. (Parameter ‘provider’)
I checked for outdated packages via
npm outdated
This one stuck out:
azure-functions-core-tools 4.0.4915 4.0.5198 4.0.5198 node_modules/azure-functions-core-tools redacted
So I updated it:
npm update azure-functions-core-tools
Now the Azure Function emulator starts correctly. This time only half an hour lost.
TL;DR When you upgrade to node 18 you will find that azure functions can no longer be debugged, you need to update azure-functions-core-tools to at least version 4.0.4915.