Occasionally I have an issue when I call an azure function from a logic app. This is the error:
“Date”: “Thu, 24 Nov 2016 00:32:40 GMT”,
“Content-Type”: “application/json; charset=utf-8”,
“Message”: “The ‘code’ query parameter provided in the HTTP request did not match the expected value.”
When you browse the internet you will find this issue multiple times. In all posts, it’s mentioned that the function can successfully be tested via the Azure Portal. So, there’s no issue with the function code. If you open the logic app and look for the code query parameter when calling the function, you will not find that.
The next step is to go to the portal and find the function in the function container. On the main page where you find the function code, you will see a link “Get function URL”. If you click this link, you will for instance see the following Url:
Here you see the code parameter and a parameter clientId equals default. ClientId default refers to the default function key. You can find this key on the Manage tab. Some posts indicate that you have to regenerate the default key or add a new function key. Both solutions didn’t work for me.
Finally I found a post that said I had to duplicate the function call in the Logic App. So, after FilterTGDocument I added a second call named FilterTGDocument2. After resubmitting the logic app I noticed I could successfully call both functions. Strange but true. Then I removed functional call FilterDocument2 again and it kept working. Strange indeed, but I wanted to share the results of my little investigation. The issue has been reported to Microsoft.