Last active
August 27, 2023 16:37
-
-
Save AlexanderHolmeset/2e837dc9c46c76eff2da1f36832a6815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TenantID = "xxxxxx" | |
$LogicAppSeObjectID = "xxxxxxx" | |
$ServicePrincipalId = $LogicAppSeObjectID | |
$GraphResource = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'" | |
$application_role_to_assign_name = "Chat.Read.All" | |
$Permission = $GraphResource.AppRoles | Where-Object {$_.value -in $application_role_to_assign_name} | |
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $ServicePrincipalId -PrincipalId $ServicePrincipalId -AppRoleId $Permission.Id -ResourceId $GraphResource.Id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment