Suddenly receiving 400 bad request when Logic app calls Azure function

Kyle Mann 1 Reputation point
2025-03-11T10:04:50.1866667+00:00

Hi guys,

In one of my logic apps I've started getting a 400 bad request when it tries to call one of my functions, I'm using the function connector so no http call, I've not made any changes in a long time to bring this error on, other logic apps can call the function without a problem, I've tried to re add the action to call the function with and without a header of x-functions-key but this has made no difference, the response I get from the function is shown in the screenshot and doesn't mention any reason for the failure, can anyone please help?

Thanks,

KyleScreenshot 2025-03-11 100208

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,389 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 3,830 Reputation points Microsoft External Staff
    2025-03-11T20:00:12.4366667+00:00

    @Kyle Mann ,
    A "400 Bad Request" error when calling an Azure function from a Logic App can occur for various reasons. One common cause is that the trigger or action has a longer name, which may exceed the default character limit for the underlying URI. To resolve this, you can adjust the UrlSegmentMaxCount and UrlSegmentMaxLength registry keys on your computer. Here are the steps:Open the Run window and run the regedit command to open the registry editor.

    Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters.

    Find the UrlSegmentMaxCount and UrlSegmentMaxLength keys. If they don't exist, you can add them.

    Increase the values of these keys to accommodate the longer URIs you are using.

    Restart your computer for the changes to take effect.

    Additionally, ensure that the function app is correctly configured and that any required headers, such as x-functions-key, are included if necessary. If the issue persists, you may want to check the function's logs for more details on the failure.


    References:


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.