Navigation
20.10. Sync Microsoft Entra Tenants and Contacts for MSP Clients
Connect Microsoft Entra to discover managed client tenants, map them to AlgaPSA clients, and sync Entra users into client contacts.
Availability: Microsoft Entra sync and connection diagnostics require Enterprise Edition and the Pro tier.
Microsoft Entra sync helps MSPs keep client contacts current without manually recreating every user from Microsoft 365. After you connect your partner identity source, AlgaPSA can discover managed Entra tenants, match them to client records, and create or update contacts for those clients.
Throughout this guide, the client names are fictional MSP examples. Use this workflow when your MSP manages clients like GreenLeaf Dental Group, Northstar Accounting, or Pioneer Law Group through Microsoft partner access and wants cleaner contact records for tickets, billing contacts, approvals, and client communication.
Figure 1: The Entra integration opens as a guided setup wizard: Connect, Find tenants, Match to clients, then Preview & pilot.
The Connect step states the permissions requested and the effect on your contacts before you authorize anything — Alga reads tenants and user names, emails, phone numbers, and job titles, and never writes back to Microsoft, reads mail, files, calendars, or Teams messages. Copy for a change record puts that summary on the clipboard for your change-management process.
Two connection methods are offered. Most MSPs should choose Direct Microsoft partner, where Alga talks to Microsoft Graph through your partner relationship. Choose CIPP (CyberDrain Improved Partner Portal) only if you already run a CIPP instance.
What Entra sync does
| Area | What AlgaPSA does | MSP benefit |
|---|---|---|
| Tenant discovery | Finds managed Microsoft Entra tenants visible to your partner connection. | Reduces manual setup when onboarding multiple Microsoft 365 clients. |
| Client mapping | Suggests matches between Entra tenants and AlgaPSA clients by domain or name. | Helps avoid syncing GreenLeaf users into the wrong client record. |
| Contact sync | Creates contacts or links existing contacts by email address. | Keeps service desk and billing contact records aligned with Microsoft 365 users. |
| Field updates and portal provisioning | Optionally updates name, phone, job title, and related identity fields from Entra. Where enabled, mappings can also control Entra-managed client-portal user provisioning, auto-link SSO behavior, and default portal role assignment. | Lets your MSP choose which system is authoritative for contact details while keeping portal access aligned with Microsoft identity. |
| Reconciliation | Queues ambiguous matches for human review. | Prevents unsafe merges when more than one contact could match the same Entra user. |
Entra sync is designed to be non-destructive. It creates, links, updates, or marks contacts inactive when an Entra account is disabled; it does not delete contacts.
Prerequisites
Before you start, confirm the following:
- AlgaPSA access: You are an AlgaPSA administrator with permission to update system settings.
- Edition and tier: Microsoft Entra sync requires Enterprise Edition and the Pro tier. Navigate to Settings > General in the sidebar to open Admin Settings, then select Integrations under Data & Integration and open Identity.
- Microsoft access: Your Microsoft partner tenant has access to the client tenants you want to sync.
- Microsoft partner connection: Use Microsoft delegated partner access for managed tenants.
- App registration: The Microsoft Entra app you connect with must be registered for Accounts in any organizational directory (multi-tenant), with the delegated Microsoft Graph permissions
ManagedTenants.Read.All,Directory.Read.All,User.Read, andoffline_access. A Global Administrator in your own tenant grants admin consent for these when you connect. Each client tenant must also admit the app before its contacts can sync; see Grant the app access in each client tenant. - Client records: Create or review AlgaPSA clients before mapping. Add clear websites, billing email domains, or client names so matching works well.
Recommended setup scenario
For this guide, assume your MSP, Northwind MSP, supports these clients:
| Entra tenant | AlgaPSA client | Example sync outcome |
|---|---|---|
| GreenLeaf Dental Group | GreenLeaf Dental Group | Creates and links dental office contacts for support tickets and billing questions. |
| Northstar Accounting | Northstar Accounting | Keeps Microsoft 365 user names and phone numbers current for tax-season support. |
| Pioneer Legal Services | Pioneer Law Group | Requires review because the Entra tenant name differs from the AlgaPSA client name. |
| Harbor Clinic | No matching client yet | Can be imported as a new client or skipped until onboarding is ready. |
Step 1: Open the Entra integration
- Navigate to Settings > General in the sidebar to open Admin Settings.
- Select Integrations (under Data & Integration).
- Open the Identity category.
- Review the Microsoft Entra Integration card.
The setup mode shows four guided steps: Connect, Find tenants, Match to clients, and Preview & pilot. Complete them in order. Nothing is written to your contacts until you have seen a preview and approved it.
Step 2: Connect Microsoft Entra
In the Connection Options area, choose the direct Microsoft partner connection.
- Click the direct Microsoft connection option.
- Sign in with the appropriate Microsoft partner administrator account.
- Review and approve the requested Microsoft permissions.
- Return to AlgaPSA and confirm the connection health shows connected.
Operational check: Use a named integration owner, such as your service operations manager or identity lead, so token rotations and permission reviews have a clear owner.
Connect through CIPP instead
If you chose CIPP, AlgaPSA connects with a CIPP API client: an Entra app that CIPP creates for API access. AlgaPSA uses the client's ID and secret to request its own short-lived access token from Microsoft and renews it automatically, so there is no key to copy and rotate by hand. Plan about 15 minutes the first time, because CIPP can take a while to show the Tenant ID.
In CIPP
- Go to Integrations > CIPP-API.
- Choose Create New Client.
- Enable the client.
- Choose Save to Azure.
- Copy the client secret. CIPP shows it only once. If you miss it, create a new secret and use that.
- Copy the Tenant ID and the API URL from the same page, along with the Application (client) ID. The Tenant ID can take 5 to 15 minutes to appear after the first save; wait and refresh the CIPP page.
In AlgaPSA
Figure 2: Selecting the CIPP card lists what you need from CIPP and changes the button to Set up CIPP connection.
On the Connect step, select the CIPP (CyberDrain Improved Partner Portal) card and click Set up CIPP connection. In the Connect CIPP dialog, fill in the fields in this order:
Figure 3: The Connect CIPP dialog repeats the CIPP steps above the four fields.
| Field | What to enter |
|---|---|
| API URL | The API URL from CIPP. It ends in /api; AlgaPSA accepts it with or without that suffix. Use the CIPP-API address, not the address you sign in to CIPP with. |
| Application (client) ID | The client's Application (client) ID. |
| Client secret | The secret value you copied. Paste the secret's value, not its ID. |
| Tenant ID | The Tenant ID shown next to the client on the CIPP-API page. |
Figure 4: With all four fields filled in, Test connection is available. Connect stays disabled until the test passes.
Select Test connection. AlgaPSA requests a token, then reads CIPP's tenant list and the users of one tenant (this read happens in the dialog's test, not in connection diagnostics). Connect stays disabled until the test passes for exactly the values on screen, so a typo never replaces a working connection. The client secret is stored encrypted and is not shown again.
If your client restricts access
CIPP lets you limit an API client. Both limits can make the test fail even though the credentials are right:
| CIPP setting | What to do | What you see in AlgaPSA when it is wrong |
|---|---|---|
| Allowed IP Ranges | Add AlgaPSA's egress IP addresses to the ranges. | CIPP refused the access token: CIPP answered 403 for every request, including the tenant list, and the message points to Allowed IP Ranges. |
| Custom Roles | Allow listtenants, listusers, listgroups, listusergroups and ListMailboxes. | CIPP's Custom Role blocks a permission sync needs: CIPP refused one named endpoint while others worked, and the message names it. If the tenant list itself is refused, the message suggests the IP allowlist first and then the role. |
Other messages you may see: Microsoft rejected the API client's sign-in (wrong or expired secret, wrong client ID or Tenant ID, missing admin consent, or a scope problem), and CIPP could not be reached at this URL (a typo in the host, a firewall, or an API URL that points at the CIPP web page instead of the API). Each message tells you what to check.
Figure 5: A failed test names the cause and what to check. Here the API URL's host name does not resolve.
Reconnect a connection that uses an old CIPP API key
To rotate the secret on an API-client connection, open the console's Connection tab and click Rotate credential. The dialog opens as Reconnect CIPP with the API URL, Application (client) ID and Tenant ID filled in; enter the new Client secret, select Test connection, then Connect. The current connection keeps working until the new details pass the test.
Connections made before CIPP introduced API clients used a static API key, which CIPP no longer issues. They keep working, and their connection details show a warning badge and this notice: "This connection uses a legacy CIPP API key. It keeps syncing unchanged. Reconnect to switch to a CIPP API client." Click Reconnect beside the notice (in the setup wizard, or in the console's connection details). The Reconnect CIPP dialog opens in API client mode with the API URL filled in; enter the Application (client) ID, Client secret and Tenant ID from Integrations > CIPP-API, then Test connection and Connect. Your existing connection keeps working until the new details pass the test, at which point the new client replaces the old key. If the test fails, the old key stays in place. A Use a legacy API key instead link is still available for existing key-based setups.
Figure 6: A connection that still uses a legacy CIPP API key shows this notice with a Reconnect button.
Step 3: Discover managed tenants
After the connection is active, click Run Discovery.
AlgaPSA loads the managed Entra tenants visible to your connection and records the last discovery time. Discovery does not create contacts yet. It only prepares the tenant list for mapping.
After setup, use Run Discovery in the tenant-mapping section of the Connection tab when you add a new Microsoft 365 client, complete GDAP setup, or change partner tenant access. The console reports the discovered tenant count and refreshes the mapping table so you can review or assign tenants in the same view. Discovery errors appear inline; check them before treating an empty list as a successful discovery with no tenants.
Step 4: Map Entra tenants to AlgaPSA clients
Open Review Mappings to confirm how discovered Entra tenants should connect to AlgaPSA client records.
Figure 7: Review auto-matched tenants, choose a client for unmatched tenants, import a new client, or skip tenants that are not ready for sync.
Mapping statuses you may see:
| Status | Meaning | Recommended action |
|---|---|---|
| Auto-matched | AlgaPSA found a strong match, usually by domain. | Review it, then confirm if correct. |
| Needs review | AlgaPSA found a possible match but is not confident enough to choose automatically. | Select the correct client manually. |
| Unmatched | No likely client was found. | Select a client, import as a new client, or skip. |
| Skipped | You chose not to map this tenant right now. | Remap later when the client is ready. |
For example, greenleafdental.example may match GreenLeaf Dental Group automatically. A tenant named Pioneer Legal Services may need manual review if the AlgaPSA client is named Pioneer Law Group.
After reviewing rows, click Confirm Selected Mappings.
Operational check: Do not confirm mappings solely by display name. Check the primary domain, client billing domain, and client website before syncing contacts.
Grant the app access in each client tenant
Discovery reads your partner relationship, so it works as soon as your own tenant has consented. Syncing a client's contacts is different: AlgaPSA reads that client's directory directly, and Microsoft only allows that after the client tenant has admitted your app. A mapped client whose tenant has not granted consent will fail every sync with a credentials error, no matter how the mapping looks.
For each client tenant you mapped:
-
Open the admin consent page for that tenant in a browser:
https://login.microsoftonline.com/<client-tenant-id>/adminconsent?client_id=<your-app-client-id>Replace
<client-tenant-id>with the client's Entra tenant ID or their primary domain (for examplegreenleafdental.example), and<your-app-client-id>with the Application (client) ID of the app you connected with, from App registrations in your own tenant. -
Sign in as someone allowed to grant consent in that tenant: the client's own Global Administrator, or your account if your delegated (GDAP) role there permits granting tenant-wide admin consent.
-
Approve the requested permissions. To verify, open Enterprise applications in that client tenant and confirm your app is listed.
Consent usually takes effect within a few minutes. If a client tenant enforces Conditional Access policies that require multi-factor authentication or a compliant device for external users, those policies can still block sync; see Troubleshooting.
Operational check: Grant consent for one client, run a sync for just that client, and confirm it completes before repeating for the rest.
Step 5: Choose field sync controls
Field sync controls decide which Entra values can overwrite fields on already-linked AlgaPSA contacts.
Common MSP choices:
| Field | Typical setting | Why |
|---|---|---|
| Display Name | On | Useful when Microsoft 365 is the source of truth for staff names. |
| Usually Off | Prevents accidental contact routing changes if aliases or UPNs differ. | |
| Phone | On | Keeps help desk callback details current. |
| Role | On | Keeps job titles such as Office Manager or Controller current. |
| UPN | Usually Off | Enable only if your team uses UPN for identity troubleshooting. |
Click Save Field Sync Controls after changing the switches.
Choose which users are imported
In the operations console, open Field rules and find Import filter to set defaults for managed tenants. To adjust one mapped client, open Clients, select Preview changes on its row, and use the Import filter panel in the expanded row.
| Control | Effect |
|---|---|
| Members only | Excludes users identified as guests. |
| Licensed users only | Excludes users with no assigned licenses. |
| Include security group | Per-client group checkboxes restrict import to members of the selected groups. With no include groups configured, this restriction does not apply. |
| Exclude security group | Per-client group checkboxes exclude members of selected groups, even when they also belong to an included group. Inherited excluded groups cannot be unchecked here. |
| Additional exclusion patterns (one regular expression per line) | Adds per-client patterns matching names, email addresses, or UPNs. Tenant-wide patterns remain in effect; in Field rules, use Add pattern to add them to the defaults. |
| Deactivate linked contacts excluded by this filter | Marks already-linked contacts inactive when the filter excludes them; it does not delete them. |
| Import shared mailboxes | Includes recognized shared mailboxes as contacts. Leave it off to exclude them. |
Group membership includes nested groups with Direct Microsoft partner; CIPP may return direct members only. Review the warning if you select a broad group such as All Users. If user-type or license data is unavailable, affected users remain in scope and the preview reports the missing data.
Recognized shared mailboxes are excluded by default. When Import shared mailboxes is enabled, they can be imported even if their sign-in account is disabled or unlicensed; member and license restrictions do not apply to them. Group and exclusion-pattern filters still apply. Imported shared mailboxes do not receive client-portal user provisioning. If the provider cannot identify shared mailboxes, the preview reports that limitation rather than guessing from license status.
The per-client panel labels values as Inherited, Overridden, or unsaved. For clients without a saved override, Members only and Licensed users only are recommendations marked Recommended – not saved. Use Preview to check the draft, then Save filter to make it effective. Reset removes the saved client override and returns to inherited defaults; any recommendations shown afterward remain unsaved until you save them.
Step 6: Preview, pilot, then run the initial sync
After at least one tenant is mapped, do not sync everything at once. The Preview & pilot step exists to make the first sync boring.
- Preview a sync. AlgaPSA reports exactly what a run would do — contacts it would create, link, update, inactivate, and queue as ambiguous — without writing anything. Read it before you approve it.
- Pilot a single client. Run the sync against one mapped tenant only. Pick a client you know well, ideally a small one, and check the resulting contacts by hand.
- Run the rest. Once the pilot looks right, run the remaining tenants.
This sequence catches the two mistakes that are expensive to undo at scale: a tenant mapped to the wrong client, and field sync controls that overwrite contact details you meant to keep.
When you are ready, click Run Initial Sync.
During the sync, AlgaPSA processes each mapped tenant and handles users as follows:
- Ignored: Disabled user accounts, users without valid email identities, common service account patterns, and users excluded by the saved import filter are skipped. Recognized shared mailboxes follow the exception described above when their import is enabled.
- Created: New people are created as contacts under the mapped AlgaPSA client.
- Linked: Existing contacts are linked when there is one clear email match.
- Updated: Enabled field sync controls may update linked contact fields.
- Queued: Ambiguous matches are sent to the reconciliation queue for review.
- Inactivated: Contacts linked to disabled Entra accounts may be marked inactive rather than deleted.
Step 7: The operations console
Once the first sync completes, the setup wizard is replaced permanently by an operations console. The wizard does not come back — the connection is now something you run rather than something you set up.
The console has seven tabs:
| Tab | What it is for |
|---|---|
| Overview | Current state at a glance: what is mapped, what synced last, what needs attention |
| Sync & schedule | Set the sync schedule |
| Clients | Every mapped tenant with its client, per-client sync results, previews, and import-filter overrides |
| Field rules | Choose which contact fields Entra can update and set the default import filter |
| Review queue | Resolve ambiguous contact matches |
| History | Recent sync runs with per-tenant outcomes |
| Connection | Credential status, credential rotation, the exportable connection record, and tenant mappings with Run Discovery |
Preview is still available after setup. Use it before any sync that follows a change to mappings or field controls — it is the same non-destructive dry run offered during onboarding.
Rotate a credential in place
The Connection tab rotates the Microsoft credential without dismantling the integration. Tenant mappings, client links, and sync history all survive the rotation, so a scheduled secret rotation is no longer a reason to rebuild the connection.
Export the connection record
Connection also exports the connection record — the permissions granted, when they were authorized, who authorized them, and the current credential state. This is the artifact to attach to a change ticket or hand to an auditor asking what access your PSA holds over client directories.
Monitor sync runs and resolve ambiguous matches
Use the History and Overview tabs to review recent sync runs and clear the ambiguous match queue.
Figure 8: After sync, review run results and resolve ambiguous contact matches before they affect service desk records.
Review sync history
The Recent Sync Runs panel shows:
- Run type, such as initial or all-tenants.
- Completion status.
- Start and completion time.
- Number of tenants processed.
- Success and failure counts.
Click View details when you need per-client results, such as how many contacts were created, linked, updated, inactivated, or queued as ambiguous.
Resolve ambiguous matches
Ambiguous matches happen when AlgaPSA finds more than one possible contact for the same Entra user. For example, Jordan Lee at GreenLeaf Dental Group might match both an office manager contact and a billing contact.
For each queue item:
- Review the Entra user name and email.
- Review the candidate contacts.
- Choose an existing contact when one is correct, then click Resolve to Existing.
- Click Resolve to New if the Entra user should become a separate contact.
Operational check: Assign someone on the service desk or client success team to review ambiguous matches after each initial client onboarding sync.
Ongoing operations checklist
Use this checklist after the initial sync is complete:
- Run discovery after adding a new Microsoft 365 client or changing Microsoft partner access.
- Preview a sync after changing mappings or field sync controls, before running it.
- Review unmapped and skipped tenants monthly.
- Check recent sync runs for failed tenants on the History tab.
- Clear the ambiguous match queue before major client communication campaigns.
- Review field sync controls before turning on email or UPN updates.
- Confirm inactive contacts before removing them from client-facing workflows.
- Rotate the Microsoft credential on your normal schedule from the Connection tab, and export the connection record when your change process needs evidence.
Related identity features
Entra sync creates and maintains client contacts. Two related capabilities cover people signing in:
- Client portal SSO lets client contacts sign in with their own Microsoft accounts, with an Entra access group deciding who gets portal access. Tenant mappings here can also drive portal provisioning mode and default portal role.
- SCIM user provisioning lets Entra deactivate and reactivate your own internal AlgaPSA users.
Troubleshooting
Run connection diagnostics
When discovery or contact sync fails, diagnostics help your identity lead find the failing layer before changing credentials or client mappings. Go to Settings > Data & Integration > Integrations > Identity, open the Entra console's Connection tab, and click Run diagnostics beside Validate. Running diagnostics requires the system_settings:read permission.
The dialog walks the connection in order and shows Pass, Warn, Fail, or Skip for each check:
| Layer | Direct Microsoft partner connection | CIPP connection |
|---|---|---|
| AlgaPSA readiness | Checks access, the saved connection, Microsoft app registration binding and secret, and sync worker and schedule health. Expected app registration values are provided for manual comparison. | Checks access, the saved connection, sync worker and schedule health, and CIPP credentials. A Direct Microsoft app registration is not required for CIPP. |
| Authentication and reachability | Refreshes the partner token, checks its scopes, and tests Microsoft Graph access. | Checks the saved CIPP credentials, then requests an access token for the API client (legacy API-key connections skip this step), then tests the CIPP API URL and authentication. |
| Tenant discovery | Reads managed tenants and compares them with confirmed client mappings. | Reads CIPP's tenant list and compares it with confirmed client mappings. |
| Sync health | Reviews recent runs, the latest per-client results, and the reconciliation queue. | Reviews the same local sync history and reconciliation queue. |
If a layer fails, dependent checks stop and show Skip with a Blocked by explanation. Independent checks, such as local sync history, still run. Expand the failed step and follow Recommendations: Microsoft failures retain the AADSTS code alongside the named remedy, so an expired secret, missing consent, and a Conditional Access requirement lead to different fixes. For CIPP failures, the step tells you whether the token request, the IP allowlist or a Custom Role is the cause: fix the API client in Integrations > CIPP-API (or reconnect with a new secret) rather than replacing a Direct Microsoft app secret.
For example, AADSTS7000222 calls for rotating the app secret in Microsoft and updating it in AlgaPSA. AADSTS65001 calls for consent in the tenant named by the failure. Partner consent requires reconnecting afterward; missing consent in GreenLeaf's tenant must be resolved in GreenLeaf's tenant.
If the connection passes but a particular client still fails, select that client under Selected client diagnostics and click Run client diagnostics. The client results name the affected tenant and remedy. Re-run the checks after applying the fix.
Export evidence and refresh discovery
Use Copy support bundle or Download JSON to share the diagnostic result with support. Exports redact identifiers by default and exclude full tokens and secrets while retaining request IDs for investigation. Include identifiers in export lets you retain identifiers when support needs that context; it does not include full credentials.
Diagnostics inspect the connection without changing client mappings or contacts or starting a sync. Token refresh can renew stored authentication tokens. To refresh the saved tenant list after setup or a partner-access change, return to Connection and click Run Discovery, then review mappings before syncing contacts.
When connecting fails
If Connect returns you to AlgaPSA with an error, the message names the cause and confirms that nothing was saved. Fix the cause in Microsoft, then connect again.
| Message begins with | Cause | Fix |
|---|---|---|
| "Microsoft rejected the sign-in because this app registration is single-tenant." | The app only accepts accounts from its own directory. | In the app registration, open Authentication and set Supported account types to Accounts in any organizational directory. |
| "Microsoft could not find this app in the directory named by the Tenant ID…" | The Microsoft tenant ID on the Microsoft app profile does not match the directory where the app is registered. | Enter the directory (tenant) ID of the app's home directory on the profile. |
| "The account you signed in with is from a different directory than this single-tenant app." | You signed in from a directory other than the app's own. | Make the app multi-tenant, then reconnect. |
| "Microsoft rejected the redirect URI because it is not registered on the app." | The redirect URI is missing from the app registration. The message includes the exact URI. | Add that URI under Authentication > Web redirect URIs. |
| "Microsoft rejected the client secret on the Microsoft profile." | The secret's Secret ID was saved instead of its Value. | Copy the secret Value into the profile. |
| "The client secret on the Microsoft profile has expired." | The secret has passed its expiry date. | Create a new secret in Azure and update the profile. |
The Microsoft app's Values to copy into Microsoft Entra card lists every redirect URI with a Copy button, which avoids typing mistakes that cause the redirect URI error.
Common problems
| Problem | What to check |
|---|---|
| The Identity category is missing | Confirm Enterprise Edition and Pro tier access. |
| Discovery finds no tenants | Confirm Microsoft partner access and GDAP relationships. |
A sync or preview fails with "Microsoft rejected the stored credentials" and consent_required or AADSTS65001 | The app has not been granted admin consent in that client's tenant. Follow Grant the app access in each client tenant; reconnecting your own tenant does not fix this. |
The error mentions AADSTS700016 | Your app registration is limited to your own directory. In App registrations > Authentication, set supported account types to Accounts in any organizational directory, then retry. |
The error mentions AADSTS50076 or AADSTS50079 | A Conditional Access policy in the client tenant requires multi-factor authentication or a compliant device for your account. Review that tenant's policies for external users with the client's administrator. |
| Discovery and mapping work, but every sync for a client fails with a credentials error | Work through the three rows above in order: client-tenant consent first, then app registration account types, then Conditional Access. Sync history shows the exact Microsoft error code for each run. |
| A tenant matched the wrong client | Do not confirm it. Select the correct client manually or improve the client website/billing domain first. |
| A tenant is unmatched | Select a client manually, import it as a new client, or skip it until onboarding is ready. |
| Contacts are not updating | Check field sync controls; only enabled fields can overwrite linked contacts. |
| Service accounts appear in sync | Add exclusion patterns for naming conventions such as svc-, automation, or noreply. |
| A user matched multiple contacts | Resolve the item in the ambiguous match queue instead of creating duplicates. |
Best practices for MSPs
- Keep client domains accurate in AlgaPSA before running discovery.
- Map tenants in batches and review each domain before confirming.
- Leave email overwrite disabled unless your operations team has agreed that Entra should control contact email addresses.
- Use the reconciliation queue as part of onboarding closeout for new managed clients.
- Treat disabled Entra accounts as an offboarding signal, but review important billing or executive contacts before removing them from workflows.
