Reputation: 147
I am trying to get all the azure app registrations and view expiry date of secrets using a app registrations and azure cli commands, provided below permissions to the app registration.
But, getting below message while login in to the Azure AD using the service principal name and cli commands.
Also, This --allow-no-subscriptions option did not help.
Please share your suggestions and comments. Thank you in Advance.
Upvotes: 4
Views: 9336
Reputation: 42063
The first error means your service principal is not in any Azure Subscription, as you used, you could use --allow-no-subscriptions
to solve this.
The second error means your service principal does not have the permission to run the command az ad app list
, i.e. list the app registrations in the AAD tenant.
To solve the issue, you have two options.
1.Add permission Application permission in Azure Active Directory Graph
e.g. Application.Read.All
(Note: Not Microsoft Graph
).
2.Give an Azure AD admin role e.g. Application Administrator
to your service principal as mentioned in the comment, follow this doc.
Upvotes: 3