---
id: object/codeunit/9012
type: object
title: Codeunit 9012 "Azure AD Graph"
summary: Codeunit 9012 "Azure AD Graph" in System Application (System.Azure.Identity). 24 public procedures. Present since at least BC23, still in BC30, changed in BC26.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: "26"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: b0efde912b243ea254101a9f00bbb4fa19a9c1ae7fde1100b53cf0a8050bd956
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Azure%20AD%20Graph/src/AzureADGraph.Codeunit.al
    title: src/System Application/App/Azure AD Graph/src/AzureADGraph.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 9012
name: Azure AD Graph
namespace: System.Azure.Identity
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "26"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 24
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 12
  implements: 0
---

# Codeunit 9012 "Azure AD Graph"

> Codeunit 9012 "Azure AD Graph" in System Application (System.Azure.Identity). 24 public procedures. Present since at least BC23, still in BC30, changed in BC26.

System Application · System.Azure.Identity · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Azure%20AD%20Graph/src/AzureADGraph.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Procedures

- `GetUser(UserPrincipalName: Text; var UserInfo: DotNet UserInfo)`: Gets the user with the specified user principal name from Microsoft Entra.
- `GetCurrentUser(var UserInfo: DotNet UserInfo)`: Gets the current user from Microsoft Entra.
- `GetUserByAuthorizationEmail(AuthorizationEmail: Text; var UserInfo: DotNet UserInfo)`: Gets the user with the specified authorization email from Microsoft Entra.
- `GetUserByObjectId(ObjectId: Text; var UserInfo: DotNet UserInfo)`: Gets the user with the specified object ID from Microsoft Entra.
- `TryGetUserByObjectId(ObjectId: Text; var UserInfo: DotNet UserInfo): Boolean`: Tries to return the user with the specified object ID from Microsoft Entra.
- `GetUserAssignedPlans(UserInfo: DotNet UserInfo; var UserAssignedPlans: DotNet GenericList1)`: Gets the assigned plans for the specified user from Microsoft Entra.
- `GetUserRoles(UserInfo: DotNet UserInfo; var UserRoles: DotNet GenericIEnumerable1)`: Gets the roles assigned to the user from Microsoft Entra.
- `GetDirectorySubscribedSkus(var DirectorySubscribedSkus: DotNet GenericIEnumerable1)`: Gets the list of subscriptions owned by the tenant.
- `GetDirectoryRoles(var DirectoryRoles: DotNet GenericIEnumerable1)`: Gets the directory roles from Microsoft Entra.
- `GetTenantDetail(var TenantInfo: DotNet TenantInfo)`: Gets details about the tenant from Microsoft Entra.
- `IsM365CollaborationEnabled(): Boolean`: Gets the value of whether M365 collaboration is enabled.
- `GetEnvironmentSecurityGroupId(): Text`: Gets the name of the Microsoft Entra security group defined in tenant admin center. For more info, see https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/tenant-admin-center-environments#manage-access-using-azure-active-directory-groups
- `IsEnvironmentSecurityGroupDefined(): Boolean`: Returns if the Microsoft Entra security group is defined in tenant admin center.
- `GetUsersPage(NumberOfUsers: Integer; var UserInfoPage: DotNet UserInfoPage)`: Gets a list of users.
- `GetLicensedUsersPage(AssignedPlans: DotNet StringArray; NumberOfUsers: Integer; var UserInfoPage: DotNet UserInfoPage)`: Gets a list of licensed users.
- `GetGroupMembers(GroupDisplayName: Text; var GroupMembers: DotNet IEnumerable)`: Gets a list of users who are members of the specified Microsoft Entra group.
- `GetMembersPageForGroupId(GroupId: Text; NumberOfUsers: Integer; var UserInfoPage: DotNet UserInfoPage)`: Gets a list of users who are members of the specified Microsoft Entra group.
- `GetMemberIdsPageForGroupId(GroupId: Text; NumberOfUsers: Integer; var UserIdsPage: DotNet UserIdsPage)`: Gets a list of user IDs of users who are members of the specified Microsoft Entra group.
- `IsGroupMember(GroupDisplayName: Text; GraphUserInfo: DotNet UserInfo): Boolean`: Checks if a given user is a member of a Microsoft Entra security group.
- `IsMemberOfGroupWithId(GroupId: Text; GraphUserInfo: DotNet UserInfo): Boolean`: Checks if a given user is a member of a Microsoft Entra security group.
- `GetGroupName(GroupId: Text): Text`: Gets the group's display name
- `GetFirstGroupIdWithName(GroupName: Text): Text`: Gets the first Microsoft Entra group object ID that matches the provided display name.
- `GetGroups(): Dictionary of [Text, Text]`: Gets all of the Microsoft Entra security groups.
- `IsGraphUserAccountEnabled(UserPrincipalName: Text; var IsEnabled: Boolean)`: Checks if the Microsoft 365 user account for the specified principal name is enabled. Note: Even if the graph user is enabled, the account may be disabled in Business Central.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 9014 "Azure AD Graph Impl."](../codeunit/9014.md) (23 calls: `GetCurrentUser → GetCurrentUser`, `GetDirectoryRoles → GetDirectoryRoles`, `GetDirectorySubscribedSkus → GetDirectorySubscribedSkus`, …)

## Called by

- [Codeunit 9029 "Azure AD User Sync Impl."](../codeunit/9029.md) (8 calls: `FetchUpdatesForDeviceUsers → GetGroupMembers`, `FetchUpdatesForLicensedUsers → GetLicensedUsersPage`, `FetchUpdatesForSkippedUsers → IsEnvironmentSecurityGroupDefined`, …)
- [Codeunit 9018 "Azure AD Plan Impl."](../codeunit/9018.md) (6 calls: `GetAuthenticationEmailFromAuthenticationObjectID → GetUserByObjectId`, `GetGraphUserPlans → GetEnvironmentSecurityGroupId`, `GetGraphUserPlans → IsEnvironmentSecurityGroupDefined`, …)
- [Codeunit 9033 "Invite External Accountant"](../codeunit/9033.md) (4 calls: `CreateNewUser → GetUserAssignedPlans`, `CreateNewUser → TryGetUserByObjectId`, `IsLicenseAlreadyAssigned → GetUserAssignedPlans`, …)
- [Codeunit 9871 "Security Group Impl."](../codeunit/9871.md) (4 calls: `FetchAllEntraGroups → GetGroups`, `TryGetEntraGroupMembers → GetMemberIdsPageForGroupId`, `TryGetIdByName → GetFirstGroupIdWithName`, …)
- [Codeunit 9011 "Azure AD Graph User Impl."](../codeunit/9011.md) (2 calls: `InitializeGraphUser → GetCurrentUser`, `InitializeGraphUser → GetUserByObjectId`)
- [Codeunit 9017 "Azure AD User Mgmt. Impl."](../codeunit/9017.md) (2 calls: `CreateNewUsersFromAzureAD → GetUsersPage`, `SynchronizeLicensedUserFromDirectory → GetUser`)
- [Page 1978 "MS 365 License Setup Wizard"](../page/1978.md) (2 calls: `ShowAccessControl → IsEnvironmentSecurityGroupDefined`, `ShowTAC → IsM365CollaborationEnabled`)
- [Page 9033 "Invite External Accountant"](../page/9033.md) (2 calls: `GetWebClientUrl → GetTenantDetail`, `Invite → GetTenantDetail`)
- [Codeunit 3705 "Azure AD Tenant Impl."](../codeunit/3705.md) (1 call: `Initialize → GetTenantDetail`)
- [Codeunit 460 "Azure AD Licensing Impl."](../codeunit/460.md) (1 call: `ResetSubscribedSKU → GetDirectorySubscribedSkus`)
- [Codeunit 9034 "Azure AD User Subscribers"](../codeunit/9034.md) (1 call: `TryGetCountryCode → GetTenantDetail`)
- [Page 9807 "User Card"](../page/9807.md) (1 call: `OnAfterGetRecord → IsGraphUserAccountEnabled`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC26

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Azure AD Graph")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
