Configuring Federated login on a .net 6 isolated Azure function App

234 Views Asked by At

The are a lot of article out there for configuring federated login with Azure Functions. But most documentation seems to either addres the older (v2) or refer to in-process and not the isolated version of azure functions.

For the isolated functions the easy configuration on the azure function configuration pages is not available.

Is there an example out there or can one be given here on how to configure An .net 6 isolated azure function app with an API to use federated login. Or in other terns how to make [HttpTrigger(AuthorizationLevel.User, "get")] work.

1

There are 1 best solutions below

4
On BEST ANSWER

how to configure an .net 6 isolated azure function app with an API to use federated login or easy configuration

You can setup the easy configuration in .Net 6 isolated function app using below steps-

  1. Create an isolated function app and go to Authentication tab

enter image description here

  1. Add an identity provider in the following way

enter image description here

enter image description here

enter image description here

enter image description here

Once its added, you will see below

enter image description here

Also you can check, there is an app registered in your Azure AD tenant

enter image description here

Then I created default isolated function locally and deployed to function app.

Here I have taken authentication level as Anonymous, because User option is not yet available in the template while function creation.

enter image description here

Deployed..

enter image description here

Output:

enter image description here

When I called the above url in browser, then it got redirected to Azure AD, clicked Accept

enter image description here

enter image description here

Reference- MS Doc

how to make [HttpTrigger(AuthorizationLevel.User, "get")] work.

As per this MS Doc, Authorization level only have Admin, Function, Anonymous as supported values but I would suggest you to check this with product team to get the latest updates if any.