Lack of MSI Requirement documentation
According to a git hub issue opened with the permissions command there is an undocumented (at least publically (aka here)) that for the command to succeed an MSI must be used and/or it must be run on the AZ CLI locally - not in the cloud shell. Specifically the az ad app permission admin-consent command.
Reference GitHub: Azure/ azure-cli issue 8192
The requirement for MSI hinders the automation of this task (while infrequent) does reduce the repeat-ability without human intervention and documentation exceptions to automation tasks.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 6a5b5348-f67e-ef14-0529-4c80fddd4bc6
- Version Independent ID: bfd7e6b1-1fba-3d25-8ee3-5105bcf4157d
- Content: az ad app permission
- Content Source: src/azure-cli/azure/cli/command_modules/role/_help.py
- Service: active-directory
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
This is known issue in Cloud Shell and we are currently working on a solution. For now, please use CLI on a local machine as a workaround.
We do have doc for command az ad app permission admin-consent: https://docs.microsoft.com/en-us/cli/azure/ad/app/permission?view=azure-cli-latest#az-ad-app-permission-admin-consent
MSI shouldn't work for this command because you can't give it admin permission in the tenant. Only a user account is supported. Please check #12137 and see if you can get unblocked.