Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service principal privileges for app registration creation

I'm using service principal as login item for azure cli. The role of this service principal is "owner".

I'm trying to run:

az ad app list

and

 az ad app create --display-name "Test application 2" 

and getting error:

Directory permission is needed for the current user to register the application. For how to configure, please refer 'https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal'. Original error: Insufficient privileges to complete the operation.

What role should I assign to this service principal?

like image 705
Dzior Avatar asked Oct 26 '18 13:10

Dzior


People also ask

Who can create app registration in Azure?

By default in Azure AD, all users can register applications and manage all aspects of applications they create. Everyone also has the ability to consent to apps accessing company data on their behalf.

Is a service principal the same as an app registration?

Relationship between application objects and service principals. The application object is the global representation of your application for use across all tenants, and the service principal is the local representation for use in a specific tenant.


1 Answers

Your service principal is missing permissions related to reading and writing applications in Azure AD.

  1. Go to your Azure AD, "Registered applications"
  2. Find your service principal (may need to look at all applications instead of just my)
  3. Add required permissions as shown below:

enter image description here

enter image description here

Once you've selected the right permissions and done. Please click on "Grant Permissions" because these permissions need Admin consent.

enter image description here

like image 111
Rohit Saigal Avatar answered Oct 21 '22 10:10

Rohit Saigal