The Azure Portal for Flex Consumption plan Functions is throwing "Bad request" in my functions app.

J. Larry Aultman 1 Reputation point
2025-03-29T20:21:03.4766667+00:00

I am trying to troubleshoot why one of my two functions always returns Unauthorized while it is set as anonymous. When I try to go to Overview screen I see the two functions in the list, but I also see this error: We were not able to load some functions in the list due to errors. Refresh the page to try again. When I click on either of the two functions all I get on Code + test or Integration tab is:
Error while loading

Ask questions and use troubleshooting tools to investigate these errors.Diagnose and solve problems

  • BadRequest
  • Error getting host status required to get template data
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,943 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Colin Delhalle 5 Reputation points
    2025-04-10T07:52:10.81+00:00

    We were running into the exact same issue and were able to fix thanks to the answer on this thread: https://learn.microsoft.com/en-us/answers/questions/2140342/azure-functions-flex-consumption-plan-authenticati

    You can exclude path of the authentication, and apparently /admin is the dashboard path.
    So something like this in Bicep:

        globalValidation: {
          requireAuthentication: true
          unauthenticatedClientAction: 'RedirectToLoginPage'
          excludedPaths: [
            '/admin/*'
          ]
        }
    

    Or Terraform:

      auth_settings_v2 {
        auth_enabled           = true
        require_authentication = true
        require_https          = true
        unauthenticated_action = "Return401"
        excluded_paths         = ["/admin/*"]
    

    I didn't see the option to do that through the portal though.

    1 person found this answer helpful.
    0 comments No comments

  2. Larry Aultman 5 Reputation points
    2025-04-02T10:49:38.34+00:00

    I have resolved the issue via trial and error since the portal is still not working. FYI it was and still is failing with an unhandled exception in the node.js when attempting to use JSON.parse of the Microsoft credentials. Created a custom parser to work around the problem. The absence of portal functionality prevented us from getting critical log information.


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.