Unable To Update Attribute 'dateOfBirth' in Azure B2C

devopsfj 246 Reputation points
2023-07-28T08:45:22.15+00:00

Hello,

I am trying to update a user attribute 'dateOfBirth' which is documented here in MS Docs: https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-profile-attributes

When I try to PATCH my user with the following for example:

{
    "dateOfBirth": "1982-12-26T00:00:00Z"
}

OUTPUT:

{
    "error": {
        "code": "Request_ResourceNotFound",
        "message": "Resource '' does not exist or one of its queried reference-property objects are not present.",
        "innerError": {
            "date": "2023-07-28T08:41:08",
            "request-id": "",
            "client-request-id": ""
        }
    }
}

Are the docs wrong?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,173 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,301 Reputation points Microsoft Employee
    2023-07-31T06:22:31.79+00:00

    Hi @devopsfj ,

    Thanks for reaching out.

    I understand you are trying to update dateofBirth attribute using Graph API patch request but unable to do so.

    dateofBirth is not a build in attribute in Azure AD B2C. It must be added as custom attribute which is by default stored in B2C as extension_{B2C appId-without-hyphens}_dateofBirth.

    To update the dateofBirth custom attribute, you need to send patch request to the name stored in B2C as below:

    User's image

    and able to get the response as

    User's image

    Hope this will help.

    Thanks,

    Shweta


    Please remember to "Accept Answer" if answer helped you.


Your answer

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