Microsoft Entra ID (Azure Active Directory)
The Azure Active Directory Integration imports the users in Microsoft Entra ID (formerly Azure Active Directory) into xAssets as custodian records. It also builds a location hierarchy from the address fields on each user and links each custodian to their manager.
The integration reads Entra ID through Microsoft Graph. It signs in as an app registration in your tenant, with an application permission and a client secret.
Prerequisites
Before you start, check that you have the following:
- A Microsoft Entra ID tenant. The integration reads standard user properties only.
- An administrator who can register applications and grant admin consent. Admin consent for a Microsoft Graph application permission needs the Global Administrator or Privileged Role Administrator role.
- An app registration with the Microsoft Graph application permission
User.Read.All, granted with admin consent. This permission is enough to read the user properties, the on-premises account fields and each user's manager. - A client secret for that app registration. You need its Value. The Secret ID does not work.
- Outbound HTTPS (port 443) from the xAssets application server to
login.microsoftonline.comandgraph.microsoft.com. The calls run on the application server. A collection server is not used. - The xAssets Batch Service must be running (the integration runs as a batch job).
- Permission in xAssets to create credential packs.
Microsoft Graph calls
| Purpose | Request |
|---|---|
| Sign in | POST https://login.microsoftonline.com/<tenant ID>/oauth2/v2.0/token with the client credentials grant and scope https://graph.microsoft.com/.default |
| Read users | GET https://graph.microsoft.com/beta/users?$select=...&$expand=manager($select=id,displayName) |
| Next page | The @odata.nextLink address Graph returns, until there are no more pages |
The users request is held in the Azure Active Directory Integration URL setting (AzureADURL).
Setup
Step 1: Register an Application in Entra ID
- Sign in to the Microsoft Entra admin center or the Azure portal as an administrator.
- Open App registrations and click New registration.
- Enter a name, for example
xAssets Entra ID. - Under Supported account types, select Accounts in this organizational directory only.
- Click Register.
- On the Overview page, copy the Application (client) ID and the Directory (tenant) ID.
Tip: If you already have an app registration for another Azure integration, you can add the permission below to it and reuse it. See Azure Direct Integration.
Step 2: Grant the Microsoft Graph Permission
- In the app registration, open API permissions.
- Click Add a permission, select Microsoft Graph, then select Application permissions.
- Find and select
User.Read.All. Click Add permissions. - Click Grant admin consent for your organization and confirm.
- Check that the Status column shows the permission as granted.
A Delegated permission with the same name does not work. The integration signs in as the application itself. It needs the Application permission.
Step 3: Create a Client Secret
- In the app registration, open Certificates & secrets.
- Under Client secrets, click New client secret.
- Enter a description and choose an expiry period. Click Add.
- Copy the Value at once. Entra ID shows it only once.
Note the expiry date. The integration stops signing in on that date. Create a new secret before then and save it in the credential pack.
Step 4: Create a Credential Pack in xAssets
- Click the Settings gear icon (top right) > Credentials.
- Click New.
- Enter a Pack Name that starts with
Azure. The dialog then relabels the fields for an app registration. - Fill in the pack:
| Field | Value |
|---|---|
| Credential Type | Named Credentials |
| Collection Server | Application Server |
| Pack Name | Azure (the name the Integrations page recommends) |
| Azure Tenant ID | The Directory (tenant) ID from Step 1 |
| Application ID | The Application (client) ID from Step 1 |
| Client Secret | The secret Value from Step 3 |
- Click OK to save the pack.
For a pack named Azure..., the dialog also fills Optional Parameters with subscriptionid=Enter Azure Subscription ID Here. The Entra ID integration does not read this value. Leave it, or set it for the Azure inventory integrations that share the pack.
The integration reads these three fields. The tenant ID builds the sign-in address. The Application ID and Client Secret are sent as the client ID and client secret.
Step 5: Review the Settings
These settings are in Admin > Settings. The Settings tab of the integration's Setup dialog lists the ones whose codes start with Azure.
| Setting | Code | Shipped Value | Effect |
|---|---|---|---|
| Import Locations from Azure Active Directory | AzureImportLocations |
1 |
Builds the Country > State > City > Office location hierarchy and sets each custodian's location. Set it to 0 to leave locations alone |
| Include Domain in AD User Import | ADUserIDIncludeDomain |
1 |
For users synchronized from on-premises Active Directory, the custodian User ID is DOMAIN\samaccountname when this is 1 or -1, and samaccountname otherwise |
| Azure Active Directory Integration URL | AzureADURL |
The beta/users request above |
The Graph request for users. Change it only together with the data mapping |
| Custodian Authority - Microsoft Entra ID | CustodianMatch_Entra |
AddEdit |
Whether the integration can add and edit custodians. See Custodian Matching and Integration Authority |
These settings, also in the Integrations class, change which users are imported:
- Entra ID Integration - import only these email domains (
AZUREADALLOWEDDOMAINS) -- a list of email domains, for exampleexample.com,example.co.uk. Separate them with commas, semicolons or new lines. Only users whose email address is in one of these domains are imported. The whole domain must match:example.comdoes not let inmail.example.com. When the setting is blank, every domain is imported. - Entra ID Integration - include disabled accounts (
AZUREADINCLUDEDISABLED) -- select it to import disabled accounts too. When it is clear, disabled accounts are left out. - Entra ID Integration - load expected leaving dates (
AzureADLeavingDate) -- select it to copy each user's leaving date (employeeLeaveDateTime) to the custodian's Expected Leaving Date. The app registration then also needs the Microsoft Graph application permissionUser-LifeCycleInfo.Read.All, with admin consent. Without that permission, Graph can refuse the whole request with 403 Forbidden, and then no users are read. Clear by default.
Step 6: Run the Integration
- Click the Settings gear icon (top right) > Integrations.
- Select Azure Active Directory Integration by clicking its row.
- Click Queue at the top of the screen. Alternatively, click the Start icon in the row to run it at once.
- In the Integration Credentials dialog, select your pack in Credentials and click OK. Select Schedule this Integration to add a schedule as well.
- Watch the status in the batch job area. The integration reports these stages:
- "Getting data from Microsoft Entra ID"
- "Importing data from Microsoft Entra ID"
- "Importing Custodian data from Microsoft Entra ID"
- "Microsoft Entra ID Integration Completed"
Step 7: Check the Results
- Open the custodian list and find users you know are in Entra ID.
- Open one custodian and check the name, email address, job title, department and location.
- Check that the Manager field is set for a user whose manager is also imported.
Imported Data
Each Entra ID user becomes one custodian. The integration matches existing custodians on the user's identities before it adds new ones. It records the user principal name, email address, DOMAIN\account login, Entra object ID and Windows account SID. A later discovery that finds the person under any of these logins links to the same custodian. Each custodian is marked with the source Entra.
| Entra ID Property | xAssets Custodian Field |
|---|---|
displayName |
Custodian Name |
jobTitle |
Post Title |
mail |
|
mobilePhone |
Mobile |
businessPhones (first number) |
Phone |
department |
Department (added if new) |
companyName |
Company (added if new) |
streetAddress and postalCode |
Address |
userPrincipalName |
Spare1 |
manager |
Manager, matched on the manager's object ID. The manager's ID is held in Spare2 |
usageLocation |
Spare4 |
accountEnabled |
Spare5 |
id (object ID) |
Spare9 |
country, state, city, officeLocation |
Based At location |
employeeType |
Employment Type, such as Employee or Contractor. A user with no employee type in Entra ID keeps the type entered in xAssets |
employeeLeaveDateTime |
Expected Leaving Date, only when AzureADLeavingDate is selected. A user with no leaving date in Entra ID keeps the date entered in xAssets |
Users Imported
By default, a user is imported when all of these are true:
- The user type is Member. Guest accounts are left out.
- The account is enabled.
- The email domain is allowed, when
AZUREADALLOWEDDOMAINSis set.
A user whose display name matches a custodian who holds assets is always updated, even when one of the tests above fails.
Locations
When Import Locations from Azure Active Directory is on, the integration creates four location levels: country, state, city and office location. It tidies the values first:
- Commas are removed and spaces are trimmed.
United States,USAandUSbecome United States.UK,GB,Great BritainandBritainbecome United Kingdom.Deutschlandbecomes Germany.- A state written
State of XbecomesX. - A user with no country takes the country of another user in the same state.
- A missing or blank value is left out of the hierarchy. A city with no state goes straight under its country, and an office with no city under its state. An office with nothing above it is a top-level location. A user with none of the four keeps the default location.
Earlier versions named a missing value Null Country, Null State, Null City or Null Office Location. The next run moves each person to the location without the missing parts, but the old locations stay, with any assets in them. The Locations with duplicate or placeholder names data check lists them. Open it and select Merge Entra ID Placeholders above the list. Each placeholder is merged into the real location above it, or into the default location when there is none. The locations under it move up, for example United States/Null State/Boston becomes United States/Boston. A location that then repeats one that already exists is merged into it. Assets, people, purchase orders, tasks, audits and IP ranges move with them. It cannot be undone, and running it again changes nothing. See Notifications.
Troubleshooting
Authentication failed for microsoftgraph
The message includes the HTTP status and the error text from Microsoft. Check these points:
- Azure Tenant ID holds the Directory (tenant) ID.
- Application ID holds the Application (client) ID. The app's object ID is a different value.
- Client Secret holds the secret's Value. The Secret ID does not work.
- The secret has not expired.
Insufficient privileges or 403 Forbidden
The app registration does not have the User.Read.All application permission, or admin consent has not been granted. Open API permissions in the app registration and check that the Status column shows the permission as granted. If Entra ID Integration - load expected leaving dates is selected, the app registration also needs User-LifeCycleInfo.Read.All. Grant it, or clear the setting.
Users missing
Check the filters under Users Imported. Guest accounts and disabled accounts are left out by default.
Manager field empty
The manager link is set only when the manager is imported too. A guest, a disabled account or a user outside the allowed domains is not imported. Their reports get no manager link.
Scheduling
Schedule the integration to run daily. Each run brings in joiners, changes and leavers. Run it before the Azure License Import, because license assignments are matched to the custodians this integration creates. See Schedules.
Related Articles
- Azure Direct Integration -- Azure inventory and the shared Azure credential pack
- Custodian Matching and Integration Authority -- which integrations can add and edit custodians
- OKTA to Extract User or Custodian Data -- another source of custodian records
- Schedules -- automating integration runs