---
id: object/codeunit/9016
type: object
title: Codeunit 9016 "Azure AD Plan"
summary: Codeunit 9016 "Azure AD Plan" in System Application (System.Azure.Identity). 27 public procedures, 1 events. Present since at least BC23, still in BC30, changed in BC24, BC26-28.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: "28"
  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: 490261496d4193b4bcf31d0c1b0798d048a38d95b63b6852565eec37fbdfadf7
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Azure%20AD%20Plan/src/AzureADPlan.Codeunit.al
    title: src/System Application/App/Azure AD Plan/src/AzureADPlan.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: 9016
name: Azure AD Plan
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:
  - "24"
  - "26"
  - "27"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 28
  events: 1
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 1
  calls: 1
  called_by: 18
  implements: 0
---

# Codeunit 9016 "Azure AD Plan"

> Codeunit 9016 "Azure AD Plan" in System Application (System.Azure.Identity). 27 public procedures, 1 events. Present since at least BC23, still in BC30, changed in BC24, BC26-28.

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

## Events published

- `OnUpdateUserAccessForSaaS(UserSecurityID: Guid; var UserGroupsAdded: Boolean)` (integration): Integration event, raised from . Subscribe to this event to update the user groups
  - subscribers: [Codeunit 9020 "User Access Update"](../codeunit/9020.md) OnUpdateUserAccessForSaaS

## Procedures

- `IsPlanAssigned(PlanGUID: Guid): Boolean`: Checks if the plan is assigned to any user.
- `IsPlanAssignedToUser(PlanGUID: Guid): Boolean`: Checks if the plan is assigned to the current user.
- `IsPlanAssignedToUser(PlanGUID: Guid; UserGUID: Guid): Boolean`: Checks if the plan is assigned to a specific user.
- `IsGraphUserEntitledFromServicePlan(var GraphUserInfo: DotNet UserInfo): Boolean`: Returns true if the given user is entitled from the service plan.
- `AssignPlanToUserWithDelegatedRole(UserSecurityId: Guid)` (obsolete 27.0: Use AssignPlanToUserWithDelegatedRole with SkipUpdateUserAccess parameter instead.): Assigns a plan to the user based on their delegated role.
- `AssignPlanToUserWithDelegatedRole(UserSecurityId: Guid; SkipUpdateUserAccess: Boolean)`: Assigns a plan to the user based on their delegated role.
- `UpdateUserPlans(UserSecurityId: Guid; var GraphUserInfo: DotNet UserInfo)`: Updates license plans for a user.
- `UpdateUserPlans(UserSecurityId: Guid; var GraphUserInfo: DotNet UserInfo; AppendPermissionsOnNewPlan: Boolean; RemovePermissionsOnDeletePlan: Boolean)`: Updates license plans for a user.
- `UpdateUserPlans(UserSecurityId: Guid)`: Updates license plans for a user.
- `UpdateUserPlans(UserSecurityId: Guid; AppendPermissionsOnNewPlan: Boolean; RemovePermissionsOnDeletePlan: Boolean; RemovePlansOnDeleteUser: Boolean)`: Updates license plans for a user.
- `UpdateUserPlans()`: Updates plans for all users.
- `RefreshUserPlanAssignments(UserSecurityId: Guid)`: Refreshes the user plans assigned to the given user.
- `TryGetAzureUserPlanRoleCenterId(var RoleCenterID: Integer; UserSecurityId: Guid)`: Returns the plan roleCenterID for the given user.
- `DoPlansExist(): Boolean`: Returns true if at least one plan exists.
- `DoUserPlansExist(): Boolean`: Returns true if at least one user is assigned to a plan.
- `DoesPlanExist(PlanGUID: Guid): Boolean`: Returns true if the given plan exists.
- `DoesUserHavePlans(UserSecurityId: Guid): Boolean`: Returns true if the given user has at least one plan.
- `GetAvailablePlansCount(): Integer`: Gets the total number of available plans.
- `GetAllPlanIds(): List of [Guid]`: Returns the list of all valid Business Central plan IDs.
- `GetUserPlanExperience(): Enum "User Plan Experience"`: Returns the user plan experience of the user. Either Basic, Essentials, Premium or Other.
- `CheckMixedPlansExist(): Boolean`: Checks whether the plan configuration mixes different plans. Returns true if there are incompatible plans in the system. Only checks when conditions for plan check is met, otherwise returns false.
- `MixedPlansExist(): Boolean`: Returns true if there are incompatible plans in the system.
- `GetPlanNames(GraphUserInfo: DotNet UserInfo; var PlanNames: List of [Text])`: Gets plans that are assigned to a user in Office 365.
- `GetPlanNames(UserSecID: Guid; var PlanNames: List of [Text])`: Gets plans that are assigned to a Business Central user.
- `GetPlanIDs(GraphUserInfo: DotNet UserInfo; var PlanIDs: List of [Guid])`: Gets plans that are assigned to a user in Office 365.
- `CheckIfPlansDifferent(GraphUserInfo: DotNet UserInfo; UserSecID: Guid): Boolean`: Checks whether a user is assigned to different plans in Business Central and Graph.
- `IsBCServicePlan(ServicePlanId: Guid): Boolean`: Checks whether a given service plan is a Business Central service Plan

## 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 9018 "Azure AD Plan Impl."](../codeunit/9018.md) (20 calls: `AssignPlanToUserWithDelegatedRole → AssignPlanToUserWithDelegatedRole`, `CheckIfPlansDifferent → CheckIfPlansDifferent`, `CheckMixedPlansExist → CheckMixedPlansExist`, …)

## Called by

- [Codeunit 9029 "Azure AD User Sync Impl."](../codeunit/9029.md) (9 calls: `AddChangesForExistingUser → CheckIfPlansDifferent`, `ApplyUpdateFromAzureGraph → UpdateUserPlans`, `FetchUpdatesForLicensedUsers → GetAllPlanIds`, …)
- [Codeunit 9017 "Azure AD User Mgmt. Impl."](../codeunit/9017.md) (7 calls: `CreateNewUserFromGraphUser → IsGraphUserEntitledFromServicePlan`, `InitializeAsNewUser → UpdateUserPlans`, `IsUserDelegated → IsPlanAssignedToUser`, …)
- [Codeunit 9018 "Azure AD Plan Impl."](../codeunit/9018.md) (2 calls: `AddNewlyAssignedUserPlans → OnUpdateUserAccessForSaaS`, `AssignPlanToUserWithDelegatedRole → OnUpdateUserAccessForSaaS`)
- [Page 9062 "User Security Activities"](../page/9062.md) (2 calls: `GetNumberOfPlans → GetAvailablePlansCount`, `OnAfterGetRecord → DoesUserHavePlans`)
- [Codeunit 257 "Experience Tier"](../codeunit/257.md) (1 call: `CheckExperienceTier → GetUserPlanExperience`)
- [Codeunit 2916 "Page Action Provider Impl."](../codeunit/2916.md) (1 call: `GetCurrentRoleCenterId → TryGetAzureUserPlanRoleCenterId`)
- [Codeunit 40 "LogInManagement"](../codeunit/40.md) (1 call: `CompanyOpen → CheckMixedPlansExist`)
- [Codeunit 4001 "Hybrid Cloud Management"](../codeunit/4001.md) (1 call: `CanGrantPermission → IsPlanAssignedToUser`)
- [Codeunit 460 "Azure AD Licensing Impl."](../codeunit/460.md) (1 call: `NextSubscribedSKU → IsBCServicePlan`)
- [Codeunit 776 "Plan User Details"](../codeunit/776.md) (1 call: `AddPlanUserDetails → IsPlanAssignedToUser`)
- [Codeunit 7774 "Copilot Capability Impl"](../codeunit/7774.md) (1 call: `IsAdmin → IsPlanAssignedToUser`)
- [Codeunit 9003 "Team Member Action Manager"](../codeunit/9003.md) (1 call: `IsCurrentUserAssignedTeamMemberPlan → IsPlanAssignedToUser`)
- [Codeunit 9034 "Azure AD User Subscribers"](../codeunit/9034.md) (1 call: `GetInformation → IsPlanAssignedToUser`)
- [Codeunit 9170 "Conf./Personalization Mgt."](../codeunit/9170.md) (1 call: `DefaultRoleCenterID → TryGetAzureUserPlanRoleCenterId`)
- [Codeunit 9178 "Application Area Mgmt."](../codeunit/9178.md) (1 call: `IsPremiumEnabled → IsPlanAssignedToUser`)
- [Page 5555 "Permission Conflicts Overview"](../page/5555.md) (1 call: `CheckPlans → IsPlanAssigned`)
- [Page 9807 "User Card"](../page/9807.md) (1 call: `IsUserDelegated → IsPlanAssignedToUser`)
- [Page 9818 "User Security Status List"](../page/9818.md) (1 call: `OnAfterGetRecord → DoesUserHavePlans`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC26-28

## Deprecations

- procedure AssignPlanToUserWithDelegatedRole: Pending 27.0 (#if not CLEAN27), "Use AssignPlanToUserWithDelegatedRole with SkipUpdateUserAccess parameter instead."

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 Plan")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
