How to connect Microsoft Entra ID to Toolspoke

Give your Toolspoke agents read-only access to your Entra ID users, groups, apps, admin roles, devices and sign-in logs. An app registration with seven read permissions, a client secret, and an agent that reviews admin access.

Microsoft Entra ID toolkitRead a tenant's users, groups, applications, directory roles, devices and sign-in logs through Microsoft Graph.

Checked against Microsoft Entra ID's documentation on 2026-11-25.

Toolspoke's Microsoft Entra ID toolkit lets your agents read your tenant's directory through Microsoft Graph. It signs in as an app registration that you create in your own tenant, using the client credentials flow. No person is signed in, and the app holds only the read permissions you grant it. Once it's installed, any agent in the project can use it.

The toolkit is read-only. An agent can see who exists, which groups and admin roles they hold, which apps can sign in to your tenant, which devices are registered and who signed in from where. It can't disable an account, change a group, revoke sessions or delete an app. Those actions aren't in the toolkit, and the permissions below don't allow them either.

This guide sets it up, then builds an agent that reviews who holds admin roles every week. Setup takes about fifteen minutes. The last step, admin consent, needs a Privileged Role Administrator.

What an agent can do once it's connected

The toolkit has 12 named actions, and every one of them only reads:

  • People: list_users lists accounts with a simple filter, such as disabled accounts or guests. get_user fetches one person by object id or sign-in name.
  • Groups: list_groups, get_group and list_group_members. Membership is direct only, so a person in a nested group shows up under that group.
  • Apps: list_applications lists the app registrations your tenant owns. list_service_principals lists every app that can sign in here, including third-party apps someone consented to. Access reviews care most about this second list.
  • Admin roles: list_directory_roles lists the roles that are active in your tenant. list_role_assignments says who holds each one, and can resolve the ids into names.
  • Sign-ins: list_sign_in_logs reads who signed in, from which IP address and location, to which app, and whether it worked.
  • Devices: list_devices returns OS, trust type, compliance and when each device was last seen.
  • The tenant: get_organization returns the tenant's name and verified domains. Toolspoke uses it to test the connection.

What you need

  • A Microsoft Entra tenant.
  • An account that can register apps. Microsoft's quickstart asks for at least the Application Developer role.
  • A Privileged Role Administrator to grant admin consent. Microsoft's docs say Cloud Application Administrator and Application Administrator can grant consent for most permissions, except Microsoft Graph application permissions, which is what this toolkit uses.
  • A Toolspoke workspace, and a project to install the toolkit in.

Step 1: Register an app for Toolspoke

  1. Sign in to the Microsoft Entra admin center.
  2. Browse to Entra ID → App registrations and choose New registration.
  3. Name it, for example Toolspoke directory reader. Under Supported account types, choose Single tenant only. The app only needs to read your own directory.
  4. Choose Register. On the Overview page, copy the Application (client) ID and the Directory (tenant) ID.

You don't need a redirect URI. A client credentials app never shows a sign-in page.

Microsoft Entra admin center
  1. Entra ID
  2. App registrations
  3. New registration
Name
Toolspoke directory reader
Supported account types
Single tenant only
Options: Single tenant only, Multiple Entra ID tenants, Any Entra ID Tenant + Personal Microsoft accounts, Personal accounts only
Register
Copy the Application (client) ID and the Directory (tenant) ID from the Overview page. Illustration of Microsoft Entra admin center's screen. The labels are Microsoft Entra admin center's; the layout is ours.

Step 2: Add read-only Graph permissions

Open API permissions under Manage, choose Add a permission → Microsoft Graph → Application permissions, and add the permissions below. Each one is the least-privileged option Microsoft lists for these calls, and none of them allows a change.

PermissionUsed by
User.Read.Alllist_users, get_user
Group.Read.Alllist_groups, get_group, list_group_members
Application.Read.Alllist_applications, list_service_principals
RoleManagement.Read.Directorylist_directory_roles, list_role_assignments
AuditLog.Read.Alllist_sign_in_logs
Device.Read.Alllist_devices
Organization.Read.Allget_organization

Pick Application permissions, not Delegated permissions. Delegated permissions act for a signed-in user, and this app never has one.

You can leave a permission out if you don't want agents to have that data. For example, skip AuditLog.Read.All if sign-in history is off limits. The matching actions will then fail with an authorization error, and you can switch them off in step 5.

Then choose Grant admin consent, signed in as a Privileged Role Administrator. Each permission's Status should say it was granted for your tenant.

Microsoft Entra admin center
  1. Entra ID
  2. App registrations
  3. API permissions
  4. Add a permission
  5. Microsoft Graph
  6. Application permissions
Select permissions
User.Read.All, Group.Read.All, Application.Read.All, RoleManagement.Read.Directory, AuditLog.Read.All, Device.Read.All, Organization.Read.All
Add permissions
Then select Grant admin consent, signed in as a Privileged Role Administrator. Illustration of Microsoft Entra admin center's screen. The labels are Microsoft Entra admin center's; the layout is ours.

Step 3: Create a client secret

  1. Open Certificates & secrets → Client secrets → New client secret.
  2. Add a description and pick an expiry. Microsoft caps secrets at 24 months and recommends less than 12.
  3. Choose Add and copy the Value right away. Microsoft never shows it again after you leave the page. Don't copy the Secret ID by mistake.
Microsoft Entra admin center
  1. App registrations
  2. Certificates & secrets
  3. Client secrets
  4. New client secret
Description
toolspoke
Add
Copy the Value, not the Secret ID. It's never displayed again. Illustration of Microsoft Entra admin center's screen. The labels are Microsoft Entra admin center's; the layout is ours.

Put the expiry date in your calendar. When the secret expires, every call fails until you paste a new one.

Step 4: Install the Entra ID toolkit in Toolspoke

  1. In Toolspoke, open the project your agents work in. Find Microsoft Entra ID in the marketplace and add it.
  2. Paste the Directory (tenant) ID and the Application (client) ID from step 1.
  3. Paste the Client secret value from step 3.
CredentialMicrosoft Entra ID
Directory (tenant) ID
00000000-0000-0000-0000-000000000000
Entra admin centre → App registrations → your app → Overview. It names the directory the sign-in happens in, and goes into the token endpoint address.
Application (client) ID
00000000-0000-0000-0000-000000000000
Shown beside the tenant ID on the app's Overview page. This is the service principal Graph will see as the caller.
Client secret
••••••••••••••••
App registration → Certificates & secrets → New client secret. Copy the Value, not the Secret ID — the Value is shown once and never again. Grant the application permissions separately, under API permissions, and remember to click Grant admin consent: User.Read.All, Group.Read.All, Application.Read.All, RoleManagement.Read.Directory, AuditLog.Read.All, Device.Read.All and Organization.Read.All cover every action in this connector, and none of them permits a change.

get_organization answered. The credential works.

Save and test
The Microsoft Entra ID toolkit's credential card in your Toolspoke project, with its real fields.

Toolspoke checks the connection with get_organization. That proves the tenant id, the client id, the secret and the admin consent all work together.

The secret is encrypted at rest and attached to the token request by the gateway. The agent never sees it, and it never appears in the arguments an agent sends or in the audit log.

Step 5: Decide what agents may see

Nothing here can change your tenant, so there are no writes to switch off. What's left to decide is who in your company should see what. Sign-in logs, role assignments and devices are the sensitive ones: they name people, privileged access and locations.

In the project's toolkit settings, each action can be switched on or off for everyone in the project. An action that's switched off can't be called, whatever the prompt says. For example, a project whose agents only answer helpdesk questions might keep the user and group reads on and switch off list_sign_in_logs and list_role_assignments.

Microsoft Entra ID actions in your project

Agents can call 12 of 12, and none of them change anything.

Read
Looks, changes nothing.
  • list_usersList the people in the tenant, with the properties named in `select`.
  • get_userFetch one person by object id or userPrincipalName, with the properties named in `select`.
  • list_groupsList the tenant's groups with their id, name, description and type.
  • get_groupFetch one group by object id, with its name, description, type and membership rule.
  • list_group_membersList the direct members of one group.
  • list_applicationsList the app registrations in the tenant — the applications this directory owns, as opposed to the service principals that represent them.
  • list_service_principalsList the service principals in the tenant — the local identity of every application that can sign in here, including third-party apps somebody consented to and managed identities Azure created.
  • list_directory_rolesList the directory roles that are activated in the tenant, with each one's id, display name, description and roleTemplateId.
  • list_role_assignmentsList who holds which directory role.
  • list_sign_in_logsRead the tenant's sign-in logs — who signed in, from which IP address and location, on which device, to which application, and whether it worked.
  • list_devicesList the devices registered in the directory, with each one's display name, operating system and version, trust type, compliance and management state, and when it was last seen.
  • get_organizationRead the tenant's own record — display name, verified domains, country, directory size limit and creation date.
Try the switches. They start the way this guide suggests; nothing here changes your project.

Every call is recorded with the agent and person behind it, the request, the response, the status and the duration.

Step 6: Build an agent that uses it

In Toolspoke, create an agent and describe its job in one sentence. The builder proposes the instructions, the toolkits it needs, a schedule and where it should answer. You add or skip each one, then create the agent. Every piece stays editable afterwards.

The same agent answers follow-up questions when someone asks it in Slack or emails it, and it replies in the thread it was asked in. It can only read, so there's nothing for it to change by mistake.

Try it

Ask the agent in Slack, by email or in its chat:

  • Who are our Global Administrators? Are any of them guests?
  • List disabled accounts that are still members of the Finance group.
  • Which third-party apps have service principals in our tenant, and who publishes them?
  • Show failed sign-ins for [email protected] between Monday and Wednesday, with IP address and location.
  • Is the laptop named FIN-LT-042 registered, compliant and seen this week?

For sign-ins, the agent always passes a time range. Microsoft's docs say a request without one can time out. The Entra ID toolkit page lists every action.

Troubleshooting

403 on one action while the others work.

That action's permission is missing or hasn't been consented. Check API permissions for a granted status next to it, then choose Grant admin consent again.

The token request fails with an invalid client secret.

You probably pasted the Secret ID instead of the Value, or the secret has expired. Create a new secret (step 3).

Sign-in logs only go back a week.

Microsoft keeps sign-in logs for seven days on Microsoft Entra ID Free and 30 days on P1 or P2. Upgrading doesn't bring back older data.

A directory role you know about is missing from the list.

list_directory_roles only returns roles that have been activated in the tenant. Ask about role assignments instead, which key on the role definition.

Group members come back with only an id and a type.

Graph returns limited information for member types the app has no permission to read. Grant the matching permission, for example Device.Read.All for devices. Microsoft also documents a known issue: on the v1.0 endpoint, service principals aren't listed as group members.

Searches like "name ends with" are refused.

The toolkit sends simple filters only. Use a starts-with or exact-match filter instead.

Questions

Can an agent disable a user or remove someone from a group?

No. The toolkit only has the 12 read actions above, the app holds only read permissions, and nothing else in Microsoft Graph is reachable through it.

Why not sign in as a person instead?

A directory reader shouldn't depend on one employee's account and session. A client credentials app holds exactly the permissions you consented to. You can revoke that consent in your admin center at any time.

Can I use a certificate instead of a secret?

Microsoft recommends certificates for production apps, but this toolkit's credential form takes a client secret.

Connect Microsoft Entra ID to Toolspoke

Install Microsoft Entra ID in a project, give it to an agent, and every call is checked and logged.