Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "Application permissions" disabled in Azure AD's "Request API permissions"?

I'm trying to give a console app permission to call an API in Azure AD.

When I go to "Add permissions," "application permissions" is grayed out and I can only select "delegated permissions."

My understanding is that application permissions is right for the console app because it runs on the back-end and users don't sign into it.

From the help text for "application permissions":

Your application runs as a background service or daemon without a signed-in user.

The help text for "delegated permissions":

Your application needs to access the API as the signed-in user.

Why is "application permissions" disabled?

Azure's "Request API permissions" dialog with a disabled "application permission" button

like image 337
Eric Eskildsen Avatar asked Aug 06 '19 15:08

Eric Eskildsen


People also ask

How do I grant API permissions in Azure?

Select Azure Active Directory > App registrations, and then select your client application. Select API permissions > Add a permission > Microsoft Graph > Application permissions.

What is the difference between delegated and application permissions in Azure?

Application permissions vs Delegated permissionsApplication permissions allow an application in Azure Active Directory to act as it's own entity, rather than on behalf of a specific user. Delegated permissions allow an application in Azure Active Directory to perform actions on behalf of a particular user.

What is an API permission?

The Permissions API allows a web application to be aware of the status of a given permission, to know whether it is granted, denied or if the user will be asked whether the permission should be granted.


2 Answers

Per my understanding, you are exposing your custom api protected by Azure AD. If so, you need to define the application permission by editing the manifest of your api app.

enter image description here

manifest:

"appRoles": [         {             "allowedMemberTypes": [                 "Application"             ],             "description": "Apps that have this role have the ability to invoke my API",             "displayName": "Can invoke my API",             "id": "fc803414-3c61-4ebc-a5e5-cd1675c14bbb",             "isEnabled": true,             "lang": null,             "origin": "Application",             "value": "myTestRole"         }     ] 

Then the application permission will show up.

enter image description here

like image 55
Tony Ju Avatar answered Oct 05 '22 23:10

Tony Ju


you actually don't give it permissions that way. It's really confusing. Instead you add your registered app to your subscription and apply a reader role, sort of through IAM. See here:

https://medium.com/@crlmas07/programmatic-access-to-azure-portal-d925ea90831e

like image 24
A.com Avatar answered Oct 06 '22 00:10

A.com