Graph API assignLicense returns 409 Directory_ConcurrencyViolation with DirectoryValueExistsException for all users in tenant

江口 太一 0 Reputation points
2026-06-04T07:14:28.49+00:00

## Problem

Calling POST /v1.0/users/{UPN}/assignLicense via Azure Logic Apps (Managed Identity)

always returns 409 Directory_ConcurrencyViolation for every user in our tenant.

This occurs for both license assignment and removal operations.

Manual license assignment via M365 Admin Center works fine for the same users.

## Environment

  • Azure Logic Apps (Consumption) with System-Assigned Managed Identity
  • Microsoft Graph API v1.0
  • Target license: Microsoft 365 Copilot (skuId: 639dec6b-bb19-468b-871c-c5c441c4b0cb)
  • Users have Microsoft 365 E5 license
  • Region: Japan East

## Error Response


{

  "error": {

    "code": "Directory_ConcurrencyViolation",

    "message": "Error due to concurrent requests being made to the tenant. Please wait briefly and retry.",

Response headers show Retry-After is empty.

## What We Have Tried (All Failed with 409)

  • Retry policy: None (single execution only) →| 409 |
  • Exponential backoff retry (60s-300s, 3 retries) →| 409 |
  • For Each concurrency set to 1 →| 409 |
  • Standalone HTTP action outside For Each loop →| 409 |
  • Different user (tested with 2 users) →| Both 409 |
  • Remove license instead of assign →| 409 |
  • Waiting several hours between attempts →| 409 |

## Key Findings

1. Logic Apps sends only 1 request, but Entra ID processes 6+ internally

  • Logic Apps Run History: 1 execution per request
  • For Each input array: 1 item only
  • Retry policy: None
  • But Entra ID Audit Log shows:
    • User A: 6x "Update User" + 6x "Change user license" (all Failure)
    • User B: 7x "Update user" (all Failure)
  • initiatedBy in all audit log entries = our Logic App (no external processes)

2. Audit Log Status Reason (Root Cause)

Microsoft.Online.DirectoryServices.DirectoryValueExistsException

This indicates a duplicate attribute value conflict within the directory, not a simple concurrency/timing issue. The assignLicense operation triggers internal user updates that fail because a value already exists on another directory object.

3. Service plans with pending status in E5 license

| Service Plan | Status | Scope |

| INTUNE_A | PendingInput | All users (tenant-wide) |

| MICROSOFT_TEAMS_EVENTS | PendingProvisioning | Test user only |

| MESH_IMMERSIVE | PendingProvisioning | Test user only |

Note: Initially we suspected these pending plans as the root cause, but the DirectoryValueExistsException status reason suggests the real cause is a duplicate attribute conflict.

## Questions

  1. What attribute is causing DirectoryValueExistsException during assignLicense? How can we identify the conflicting attribute and the conflicting directory object?
  2. Why does assignLicense for a new SKU (Copilot) trigger multiple "Update User" operations that result in duplicate value exceptions? What user attributes are being modified as part of the license assignment process?
  3. Why does a single assignLicense API call result in 6-7 internal processing attempts? Is this an internal retry mechanism of the directory engine?
  4. Why does manual assignment via M365 Admin Center succeed while Graph API fails? Does the Admin Center use a different internal process that bypasses the attribute conflict?
  5. How can we resolve this DirectoryValueExistsException at the tenant level? Are there any diagnostic tools or Graph API endpoints to detect duplicate attribute values?
Microsoft Security | Microsoft Entra | Microsoft Entra ID

3 answers

Sort by: Most helpful
  1. 江口 太一 0 Reputation points
    2026-09-04T05:45:16.0166667+00:00

    @Shubham Sharma @Saravana Kumar D
    Here is a follow-up.

    Regarding the above,
    we have confirmed that, provided the ‘LicenseAssignment.ReadWrite.All’ permission can be linked to Logic Apps via the Managed Identity method, it is possible to use those Logic Apps to grant and revoke Copilot licences for the relevant users.

    It appears that a Microsoft representative has resolved the issue.
    Thank you for giving this careful consideration. This was a case of information sharing.

    Was this answer helpful?

    0 comments No comments

  2. taro tanaka 0 Reputation points
    2026-06-18T00:56:16.1433333+00:00

    Due to the quietly changes described in the link below, cross-request consistency is no longer guaranteed for “Application-only access.”

    https://devblogs.microsoft.com/identity/designing-for-eventual-consistency-for-microsoft-entra/

    This change has increased the likelihood of 404 and 409 errors.

    Please also refer to this link.

    https://www.linkedin.com/pulse/your-microsoft-graph-just-became-eventually-nobody-told-periwal-trd2c

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-06-04T07:14:39.45+00:00
    1. The provided information does not state that PendingInput or PendingProvisioning service plans cause Directory_ConcurrencyViolation for assignLicense on a different SKU. The documented license-assignment business logic issues are:
    • Not enough licenses available for a product.
    • Conflicting service plans that are mutually exclusive.
    • Missing dependent service plans.

    These appear as specific violations (for example, MutuallyExclusiveViolation, DependencyViolation) rather than Directory_ConcurrencyViolation.

    1. The internal retry behavior and the exact reason why a single assignLicense call results in multiple internal attempts and multiple audit log entries are not described in the provided material. The context only notes that:
    • License assignment operations can fail due to business-logic issues.
    • Errors are visible in audit logs as failed Change user license events.

    No details are given about internal retry counts or how they map to audit log entries.

    1. The context does not describe any tenant-level procedure to resolve INTUNE_A PendingInput status. It only covers how to:
    • Diagnose license assignment problems (insufficient licenses, conflicting plans, missing dependencies).
    • View and manage licenses via the Microsoft 365 admin center and Microsoft Graph PowerShell.
    • Reprocess user license assignments after fixing underlying issues.

    Given the available information, the only supported, concrete remediation steps are:

    • Verify there are sufficient licenses and no conflicting or dependency-violation conditions for the affected users and SKUs.
    • After resolving any such issues, reprocess license assignments for affected users, either:
      • In the Microsoft 365 admin center: Billing → Licenses → select product → select group → select user(s) → Reprocess.
      • Or via Microsoft Graph / PowerShell using Invoke-MgLicenseUser or the reprocessLicenseAssignment API (POST /users/{id}/reprocessLicenseAssignment).

    These steps ensure that any prior license-assignment errors are cleared and that group-based licensing state is recalculated.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.