1

I have a web API set up with Azure functions. This has been working fine from my web server for about a week. Suddenly today the functions return 401 unauthorised when call remotely but when fine in the Azure Portal. AFAIK nothing has changed.

Any one know why I now get a 401?

I have tried restarting the function app but that doesn't fix it.

Jon Farmer
  • 326
  • 1
  • 6
  • 16

2 Answers2

1

Change the AuthorizationLevel to Anonymous.

public static async Task<IActionResult> Run(
                [HttpTrigger(**AuthorizationLevel.Anonymous**, "get", "post", Route = null)] HttpRequest req,
                ILogger log){

    }
A.Muditha
  • 99
  • 1
  • 4
0

By default, when you create this function, it will start with the function (key) for the Authorization level. Please take a try to switch the Authorization level to Anonymous, this should allow the function to work.

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396