Hi Support,
I have been trying to achieve the following with an Entra App Registration:
- Using the Graph API admin consent to API Permissions for my Entra App Registration, I am well aware you can manually do this by signing into 365 as a Global Administrator and press the admin consent button to do this. I am trying to achieve this programatically.
I have reviewed the following article:
https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent?pivots=ms-graph
I am having trouble replicating the above and making it successful.
I have also reviewed the following stack overflow article where it is stated to be possible to achieve the above:
https://stackoverflow.com/questions/76568917/can-a-service-principal-or-azure-app-admin-consent-an-external-multi-tenant-app
I do understand the security implications this may pose if such a thing is possible, but from an IT administration standpoint where I have multiple tenancies I manage as an MSP I would like to be able to programmatically add and remove permissions and approve their admin consent in a more streamlined way without having to log into every single tenant then navigate to the app and repeat steps to change permissions.
The errors I have come across are 404, 400 but I have also had times where the response from graph claims its succeeded but the permissions are not showing as consented to by admin. The App has Cloud Administrator Role applied to it as well as application.readwrite.all - approved already to check these permission changes work, I have also tried granting directory.readwrite.all when testing.
If this is better raised as direct support request under a tenancy please let me know.