Insufficient privileges to complete the operation while trying to get AD groups
See original GitHub issueHi, I am trying to write a very simple script to list Azure AD groups.
- Package Name: azure-common
- Package Version: 1.1.28
- Package Name: azure-graphrbac
- Package Version: 0.61.1
- Python Version: 3.10
Here is the script:
from azure.common.credentials import ServicePrincipalCredentials
from azure.graphrbac import GraphRbacManagementClient
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=client_secret,
resource="https://graph.windows.net",
tenant=tenant_id
)
graphrbac_client = GraphRbacManagementClient(
credentials,
tenant_id
)
groups = graphrbac_client.groups.list()
for g in groups:
print(g.display_name)
The intention is to run it from “Azure automation” authenticating using a service-principle (not a user).
The app registration I created on azure for authentication has Directory.Read.All
and Group.Read.All
permissions:
But I still get:
azure.graphrbac.models.graph_error_py3.GraphErrorException: Insufficient privileges to complete the operation.
What am I missing?
I see the same issue without solution: #16018
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
"Insufficient privileges to complete the operation" while using ...
My goal is to get an access token from an App-Service as shown above and use it to create a user in azure...
Read more >Graph API - Insufficient privileges to complete the operation
AD > App Registered > your app · Select Required Permission · Click Add and select Microsoft Graph and add it · select...
Read more >Graph client: Insufficient privileges to complete the operation
Open the Azure Portal · Click Azure Active Directory · Click App registrations in the left bar · Click the app you registered...
Read more >"Insufficient privileges to complete the operation" error Upon ...
Running the "SAM - Import User Subscriptions" job results in the following error in the syslog: Unhandled exception for profile ...
Read more >Insufficient privileges to complete the operation while trying to ...
Hi! I am trying to write a very simple script to list Azure AD groups. Here is the script: from azure.common.credentials import ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Racheli-Bloch We are looking into it and get back to you for any additional information.
@Racheli-Bloch 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.