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.
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_userslists accounts with a simple filter, such as disabled accounts or guests.get_userfetches one person by object id or sign-in name. - Groups:
list_groups,get_groupandlist_group_members. Membership is direct only, so a person in a nested group shows up under that group. - Apps:
list_applicationslists the app registrations your tenant owns.list_service_principalslists 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_roleslists the roles that are active in your tenant.list_role_assignmentssays who holds each one, and can resolve the ids into names. - Sign-ins:
list_sign_in_logsreads who signed in, from which IP address and location, to which app, and whether it worked. - Devices:
list_devicesreturns OS, trust type, compliance and when each device was last seen. - The tenant:
get_organizationreturns 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
- Sign in to the Microsoft Entra admin center.
- Browse to Entra ID → App registrations and choose New registration.
- Name it, for example
Toolspoke directory reader. Under Supported account types, choose Single tenant only. The app only needs to read your own directory. - 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.
- Entra ID
- App registrations
- New registration
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.
| Permission | Used by |
|---|---|
| User.Read.All | list_users, get_user |
| Group.Read.All | list_groups, get_group, list_group_members |
| Application.Read.All | list_applications, list_service_principals |
| RoleManagement.Read.Directory | list_directory_roles, list_role_assignments |
| AuditLog.Read.All | list_sign_in_logs |
| Device.Read.All | list_devices |
| Organization.Read.All | get_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.
- Entra ID
- App registrations
- API permissions
- Add a permission
- Microsoft Graph
- Application permissions
Step 3: Create a client secret
- Open Certificates & secrets → Client secrets → New client secret.
- Add a description and pick an expiry. Microsoft caps secrets at 24 months and recommends less than 12.
- 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.
- App registrations
- Certificates & secrets
- Client secrets
- New client secret
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
- In Toolspoke, open the project your agents work in. Find Microsoft Entra ID in the marketplace and add it.
- Paste the Directory (tenant) ID and the Application (client) ID from step 1.
- Paste the Client secret value from step 3.
get_organization answered. The credential works.
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.
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.
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.