I’m trying to build a small C# console app that lists all Azure AD / Entra ID groups and the users inside them (including nested members).
The end goal is to sync these groups and users into Dataverse for a Power Apps Canvas App.
What I’ve done so far
I installed the official Microsoft Graph SDK and Azure.Identity packages:
dotnet add package Microsoft.Graph dotnet add package Azure.IdentityI followed Microsoft’s examples that use client-credentials authentication:
var credential = new ClientSecretCredential(tenantId, clientId, clientSecret); var graph = new GraphServiceClient(credential, new[] { "https://graph.microsoft.com/.default" }); var groups = await graph.Groups.GetAsync();I understand that this requires an App Registration in Entra ID (to get Tenant ID, Client ID, and Client Secret) and that the app must have Application permissions like
Directory.Read.All(with admin consent).
My problem
I only have a normal user account in Entra ID — I’m not a global admin or app-registration admin.
Because of that, I can’t register an application or grant those permissions myself.
So my questions are:
Is there any way for a non-admin user to call Microsoft Graph to read group and user data programmatically in C#?
(for example, using delegated permissions, or an alternative flow that doesn’t require app-registration rights?)If not, what’s the recommended workaround for developers who don’t have admin access —
should we ask an admin to register the app and give us the credentials,
or is there another safe pattern (e.g. using a service principal the organization already has)?Once the App Registration is created by an admin, am I correct that I can keep the Tenant ID, Client ID, and Client Secret in environment variables (or “User Secrets” in .NET) so they aren’t hard-coded?
What I’m aiming for
Read all groups (
/groups)For each group, read its transitive members (
/groups/{id}/transitiveMembers) to include nested group usersLater, save the results into SQL and push to Dataverse