Share via

Extension Attributes for Devices Should be, but are not nullable via the Graph API

Nathan Kasco 10 Reputation points
2023-02-22T18:07:17.23+00:00

Extension Attributes used to be nullable, but at some point within the last few weeks they stopped being nullable for devices.

When using the following Graph API endpoint / method:

PATCH /devices/{id}

Body:

{
    "extensionAttributes": {
        "extensionAttribute8":null
    }
}

This occurs with both the 1.0 and beta endpoints, I've repro'd the behavior in multiple tenants with both the Graph API and the MS PowerShell module.

I've also tried using "" as the value passed in the JSON.

Microsoft Security | Microsoft Graph
0 comments No comments

2 answers

Sort by: Most helpful
  1. Vasil Michev 126.1K Reputation points MVP Volunteer Moderator
    2023-02-22T18:18:41.98+00:00

    Yup, able to repro it here too. I've reported it to some MS folks and also raised an issue over at GitHub to have the documentation amended. Will let you know if someone replies with specifics.

    1 person found this answer helpful.
    0 comments No comments

  2. JuliusPIV 91 Reputation points
    2023-02-23T00:32:49.71+00:00

    This is so frustrating. We spent months working on a solution that relied on our ability to set & clear/nullify extensionAttributes and now we've got to rework the solution.

    According to a comment by Peter Ombwa in here https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1823:

    We do not support setting properties to null due to a design limitation with the code generator - Azure/autorest.powershell#961. As a workaround, please use Invoke-MgGraphRequest to set the extension properties to null. Closing as duplicate of #833.

    This comment https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/833#issuecomment-1294082532 proposes using Invoke-MgGraphRequest instead.

    What about deleting an extensionAttrbute associated with a device? Not seeing great documentation on that process

    https://learn.microsoft.com/en-us/graph/api/extensionproperty-delete?view=graph-rest-1.0&tabs=http

    https://learn.microsoft.com/en-us/graph/api/resources/extensionproperty?view=graph-rest-1.0


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.