Logic app calling azure function goes dormant after few hours
This happens if the function app is inactive for a long time or deleted and also if any of the files being deleted from the temporary storage.
Check if the below steps helps to fix your issue:
Check if your deployed function got deleted in the function app.
If your function is frequently getting deleted after deploying to the function app, add a setting SCM_DO_BUILD_DURING_DEPLOYMENT= true
in function app-> configuration-> Application Settings
as shown below:

- If you have a Function App running in a Basic/Standard/Premium App Service Plan, You can try to enable the "Always On" setting in the
function app-> configuration-> General Settings
to keep the function app running and prevent it from going inactive.

- If the function App is using a Consumption Plan, the functions will be active whenever they needed to run, So there is no need of
Always ON
.
I also noticed that if we miss to pass the required parameters, getting the same error.

After passing the parameters, got expected results:

I tried to reproduce the same in my environment by creating a Java Azure function and deployed to Azure function App.

Calling Azure function from Logic Apps:

Initially, it worked fine:

As for testing, I kept my function app idle for some time and checked:
I got 400
Bad Request error:

Followed above provided troubleshooting steps to resolve this issue. I could call the Azure function and got expected results:
