Share via

failed with status-'InternalServerError' while invoking 'GET' on 'https://*****.azurewebsites.net' and message - 'Invoking Azure function failed with HttpStatusCode - InternalServerError.'.

Anonymous
2025-03-27T07:34:57.8333333+00:00

I have an Azure Data Factory (ADF) pipeline designed to call functions from an Azure Function App in a parallel loop, processing different files with the same function. Initially, everything worked perfectly both in my local environment and after deployment to the Azure portal. However, five days ago, I encountered an issue where all function executions failed with the error:

Failed with status 'BadGateway' while invoking 'GET' on 'https://****.azurewebsites.net', along with the following message:

<html>

<head>

<title>Server Error</title>

</head>

<body>

<font color="#aa0000">

<h2>Server Error.</h2>

</font>

There was an unexpected error in the request processing.

</body>

</html>

After some time, when I re-executed the pipeline, it worked successfully, and everything seemed fine.

Since then, out of 70 runs, 4-5 runs have failed with the error: Failed with status 'InternalServerError' while invoking 'GET' on 'https://****.azurewebsites.net' and the message: Invoking Azure function failed with HttpStatusCode - InternalServerError. Other 65 runs are successful. However, when I re-execute the same runs without making any modifications, they succeed.

This issue has been recurring for the past 4-5 days, and I can't pinpoint the root cause since re-executing resolves the problem without any changes.

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. Ranashekar Guda 2,905 Reputation points Moderator
    2025-04-04T16:07:38.87+00:00

    Hi @Nayana Ramaiah,

    The errors you're seeing, like InternalServerError and BadGateway, are likely due to temporary issues with the Azure Function App or its infrastructure. Since re-running the same request without changes leads to success, it suggests the problem isn't with your code but due to service disruptions or resource constraints.

    These transient errors can happen during load spikes or brief outages and typically resolve after a retry. Other causes might include heavy load on your function app, network issues, or function timeouts. To address this, monitor performance, check connectivity, review timeout settings, and enable error logging. Implementing a retry mechanism in your pipeline can help handle these transient errors more smoothly.

    For further clarification, please refer to the following documentations: Document1, Document2

    I hope this helps resolve your issue. Feel free to reach out if you have further concerns.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

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