Last active
June 18, 2020 15:27
-
-
Save pmatthews05/981531621a467d61c3bd1701459887ae 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
#Get Graph APIServicePrinicpal information | |
$APIServicePrincipal = az ad sp list --query "[?appDisplayName=='Microsoft Graph'].{appId:appId,objectId:objectId}" --all | ConvertFrom-Json | |
#Get Directory.ReadWrite.All appRolesPermission | |
$appRolePermInfo = az ad sp show --id $($APIServicePrincipal.appId) --query "appRoles[?value=='Directory.ReadWrite.All']" | ConvertFrom-Json | |
#Add Permission (Role means Application) | |
az ad app permission add --id $appId --api $($APIServicePrincipal.appId) --api-permissions $($appRolePermInfo.id)=Role |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment