Close

Azure Function Update

After deploying my updated functions and logic apps to Production, I suddenly received the following error when calling one of the functions from a logic app:

{
  "Message": "The WebHook verification request must contain a 'code' query parameter."
}

When searching for a solution, I found out I was using an old version of Azure Functions in Production (not in DEV/TST). Check the App_Settings of your function container. Here you can find setting FUNCTIONS_EXTENSION_VERSION. This setting had a value of ~0.8 in Production and ~1 in DEV/TST. After changing the version to ~1, the problem wasn’t solved yet. In all logic apps that were using webhook functions, I had to add the code query parameter to the address of the webhook functions. Example:

"FilterAGAEvents": {
   "inputs": {
     "body": "@body('HTTP')",
     "function": {
     "id": "/subscriptions/.../resourceGroups/appfunctions/providers/Microsoft.Web/sites/functions/FilterAGAEvents?code=sOvDc1NJvZSEFAa0iLfUFcFn32zYF7LHI3Qj3eN8lFtGr7crmhxSZQ=="
     }
 ...

You can find the right code parameter from the Manage tab of your Azure Function under Function Keys / default. Note that the function key shouldn’t contain a forward slash. Forward slash is a reserved character that can’t be used in your Logic App json file.

Final thoughts. The code changes I had to make were very time consuming. A colleague said I could probably have updated the function container and then simply redeploy and save the logic app. I tried that option out and it works gracefully. Much easier! Microsoft sources indicate you must be cautious updating the function version, because it may break your function code. In the end I guess the safest approach would be to make an entirely new function container, add the functions and settings again and try if the functions can be called from the logic apps again. The problem I’m facing is that I can’t just experiment in a live environment. I will have to work carefully.

Tip: In case you receive a notification you are using an old version of Azure Functions, simply change FUNCTIONS_EXTENSION_VERSION to a higher version. Then redeploy the logic apps. This solution works. You won’t have to add the code query parameter to the function calls in your logic apps.