Azure Function App | Disaster Recovery

Abhay Chandramouli 966 Reputation points


I have an APIM which calls a function app from either of the two ways.

  1. send request
  2. set backend service id

I am trying to implement Disaster Recovery for my function apps in two regions I have.

I want to know what response does a function app return when it's down

  1. Down due to region being down
  2. Down due to being deleted.
  3. Down to due to any other reason.

I need a way to differentiate function app being down or some api returning a response when called via a function app

Please provide the status code, reason phrase and any other params which I can use to check this at APIM level.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,861 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,496 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 22,876 Reputation points

    @Abhay Chandramouli Thanks for reaching out. When a function app is down, the response that is returned can vary depending on the reason for the outage. Here are some possible scenarios and the corresponding responses:

    Function App is down due to the region being down: In this case, the Function App might not be able to respond at all because the entire infrastructure supporting it is down. You might not receive a response, or you might receive a gateway timeout error (HTTP status code 504).

    Function App is down due to being deleted: If a Function App has been deleted, any attempt to reach it would result in an HTTP 404 error. This is because the endpoint for the Function App no longer exists.

    Function App is down due to other reasons: This could include a variety of scenarios, such as the Function App failing to start, hitting a runtime error, or experiencing a configuration issue. The response in these cases can vary. For instance, if the Function App fails to start, you might see an error message indicating that the Azure Functions Runtime is unreachable. If there’s a runtime error within the Function App, the HTTP status code might be 500, indicating an internal server error.

    To differentiate between a Function App being down and an API returning a response when called via a Function App, you can look at the HTTP status code and the content of the response. If the status code is in the 4xx or 5xx range, it typically indicates an error. You can also set up custom error handling in your Function App to return more specific error messages

    I hope this helps! Let me know if you have any other questions.

    0 comments No comments