@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.