I have a problem with a logic app calling an azure function app. Its failing with an Unauthorized error

Chris Crowhurst 0 Reputation points
2025-02-17T17:19:40.6766667+00:00

I have an azure logic app "logic-nats-test-func". It calls an azure function app called "func-assurityimport-nats-dev". It is displaying "Unauthorized" when it is run.

When it is run I can see the function running by looking in the Log Stream, but it always returns this :

{ "statusCode": 401, "headers": { "Date": "Mon, 17 Feb 2025 15:55:50 GMT", "WWW-Authenticate": "Bearer", "Request-Context": "appId=cid-v1:58850597-4e54-4d55-9584-88976280b385", "Content-Length": "0" } }

I don't have any bearer token authentication enabled. I also have a test function with the same app and that works fine. Both functions are using the same function signature :

        public async Task<HttpResponseData> HttpStartNATS(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req)
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,440 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,357 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sai Prabhu Naveen Parimi 80 Reputation points Microsoft Vendor
    2025-02-20T16:37:19.97+00:00

    Chris Crowhurst

    It seems like you're encountering an "Unauthorized" error when running your Azure Logic App "logic-nats-test-func" which calls the Azure Function App "func-assurityimport-nats-dev". The error message indicates a missing valid access token.

    You've mentioned that adding the x-functions-key to the header didn't resolve the issue. Could you please confirm if you have tried invoking the function through Postman or curl with the function key? This will help determine if the issue is specific to the Logic App or if it persists across different methods of invocation.

    Your feedback on this matter would be greatly appreciated. Please let me know if this approach works or if you require further assistance.

    0 comments No comments

  2. Sai Prabhu Naveen Parimi 80 Reputation points Microsoft Vendor
    2025-02-20T16:40:16.9866667+00:00

    [Duplicate]

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.