Hello there,
I'm currently undergoing an automation integration of aad into our product. I need to create an application and give it certain permissions (i.e. Directory.ReadWrite.All). From what I've researched, this isn't yet possible with some cmdlet in powershell. So we have to use Rest-Api. What you've presented here isn't at all helpful. Basically having my account (which is an admin) credentials, the newly created application ids, the service principal and also its secrets, I need to grant it consent to certain permissions without going into the protal and press "Grant permission for this tenant".
Basically, my question is, how can I grant permissions for my tenant within powershell code? Is it possible?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@vivere-dally Thanks for your feedback! We will investigate and update as appropriate.
@vivere-dally There is no specific Powershell cmdlet available to grant admin consent. You can upvote an existing feature request over here.
However, you can check for this blog which provides a Powershell function to grant permissions silently.
Also, you can use az ad app permission admin-consent Azure CLI to grant application and delegated permissions through admin Consent. Please refer to the documentation here.
Hello
So the blog post worked. Thank you very much, I've been stuck on this for days now. I think these workarounds should be made more available to the public because I've searched so much and didn't find anything.
@vivere-dally Good to hear that you are unblocked. I will provide your feedback to the content author if it can be documented under any section.
We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.
Most helpful comment
@vivere-dally There is no specific Powershell cmdlet available to grant admin consent. You can upvote an existing feature request over here.
However, you can check for this blog which provides a Powershell function to grant permissions silently.
Also, you can use
az ad app permission admin-consentAzure CLI to grant application and delegated permissions through admin Consent. Please refer to the documentation here.