Warm tip: This article is reproduced from serverfault.com, please click

Why are assigned licenses missing from the licenseAssignmentStates collection using Graph API?

发布于 2020-08-21 07:40:09

A user in my Azure AD has two license assignments, one direct and one via a group:

Azure AD screenshot

When querying the user, one of the licenses is missing from the licenseAssignmentStates collection. The property assignedLicenses contains the other license.

https://graph.microsoft.com/v1.0/users/[UPN]?$select=licenseAssignmentStates,assignedLicenses

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(licenseAssignmentStates,assignedLicenses)/$entity",
    "licenseAssignmentStates": [
        {
            "skuId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
            "disabledPlans": [],
            "assignedByGroup": "19f1820f-21d0-4d68-8c51-678a752168bc",
            "state": "Error",
            "error": "MutuallyExclusiveViolation"
        }
    ],
    "assignedLicenses": [
        {
            "disabledPlans": [
                "aebd3021-9f8f-4bf8-bbe3-0ed2f4f047a1",
                "8c7d2df8-86f0-4902-b2ed-a0458298f3b3",
                "57ff2da0-773e-42df-b2af-ffb7a2317929",
                "a23b959c-7ce8-4e57-9140-b90eb88a9e97",
                "e95bec33-7c88-4a70-8e19-b10bd9d0c014",
                "5dbe027f-2339-4123-9542-606e4d348a72"
            ],
            "skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900"
        }
    ]
}

This is a huge problem, because if a license is not contained in the licenseAssignmentStates collection, it is impossible to know anything about the state of the license assignment or if it has been assigned by a group.

Before adding the indirect license assignment, the direct license assignment was returned in the licenseAssignmentStates collection, so I don't think it is about that.

How do I get the licenseAssignmentStates of all assigned licenses? Am I doing something wrong or is it a bug in the Graph API? If it is, what would be the best way to get it fixed quickly, we need this for our application?

Thank you very much in advance!

Questioner
Manuel K
Viewed
0
Manuel K 2021-01-07 16:32:08

Microsoft has logged it as a bug and it is in the queue for resolution: https://github.com/microsoftgraph/microsoft-graph-docs/issues/9636#issuecomment-754933971