DEV Community

Cover image for How to register an application to get the Security Group in Claims in your Azure Function
Antoine
Antoine

Posted on

How to register an application to get the Security Group in Claims in your Azure Function

Photo by Maxim Zhgulev on Unsplash

Problem

In our Azure Function, we need to check if the user is a member of an existing Active Directory group.

Solution

In order to to that, we need to:

  • set up Authentication in Azure Function, setting in "Authentication / Authorization" the button "App Service Authentication" to on and use Azure Active Directory as an Authentication Providers (using Express setting: Do not turn on Common Data Service !).
  • got to App Registrations in yout Azure Active Directory and find your application. Go to the Manifest blade, and modify it to set:
"groupMembershipClaims": "SecurityGroup",
Enter fullscreen mode Exit fullscreen mode

You should see the security groups added in the ClaimsPrincipal of your Azure Function.

Hope this helps !

Top comments (0)