"Unauthorized" error when trying to call an AzureFunction from LogicApp
Asked Answered
M

3

7

I have a logic app that executes a workflow by calling Azure Functions in a certain order. It was working fine for a few days, but recently it stopped working. In logic apps run (on Azure Portal) it looks like this: Error screen

The output of the action that was called has statusCode: 401. The Azure Function that's being called does not have any written code that returns that statusCode.

After redeploying the Logic App the issue was gone. Does anyone know what can cause such error? Maybe the Logic App somehow has problems with authenticating to the Azure Function? Could this be related to Azure Functions keys (for example if they changed)?

Multiplication answered 5/12, 2018 at 10:14 Comment(0)
N
10

Functions are secured by a an access "code"; so in order to get a function to run from a Logic App; the Logic App has to know what the access code is for the Function.

Function Access code is located here:

enter image description here

Update the Logic App here by adding the "x-functions-key" to the header:

enter image description here

Nowhere answered 13/6, 2019 at 14:32 Comment(0)
K
9

this can happen after redeploying the Function and its key changes. Redeploying the Logic App (or deleting the step that calls the Function from the Logic App Designer and adding it again) fixes the issue. The Function should work again without having to add the x-functions-key.

Keldah answered 12/9, 2019 at 12:6 Comment(0)
M
1

I'd try to check the Authorization level in the Azure Function.

Maybe you Authorization level has changed and now you must indicate the code/token in order to call it.

enter image description here

I hope I was able to help you.

Meade answered 5/12, 2018 at 10:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.