I am registering an app to Azure AD using PowerShell(Microsoft Graph SDK). I would like to add API permissions to the registered Azure AD app. I want to add it to "Configured Permissions", but it gets added to "Other Permissions". I would appreciate it if you could tell me the cause and how to deal with it. thank you.
When I executed the command below, it completed successfully, but when I opened Azure Portal, it was registered in "Other permissions". I wanted to add it to the "Configured Permissions", and although I tried several things, it was not added to the "Configured Permissions".
$AppRole = $GraphServicePrincipal.AppRoles | Where-Object {$_.Value -eq "User.ReadWrite.All" -and $_.AllowedMemberTypes -contains "Application"}
$params = @{
principalId = $servicePrincipal.Id #Service Principal ID
resourceId = $GraphServicePrincipal.Id #Microsoft Graph Service Principal ID
appRoleId = $AppRole.Id
}
# command1
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $params.principalId -BodyParameter $params
# command2
New-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $servicePrincipal.Id -BodyParameter $params
If you want to grant application permissions to your AD app and have them appear under "Configured Permissions" in the Azure Portal, you need to give yes to these permissions. as u asked see code in powershell below
This will generate consent URL
later
output the URL that is generated
After consenting this, check the Azure Portal under the "API permissions" section for your app. The app roles will appear under "Configured Permissions."