B2C Extension property creation error using graph api

Vikas Tiwari 771 Reputation points
2020-08-06T04:45:20.593+00:00

Hi,

I was trying to create extension property through graph API, explained here.

I am using app id from (b2c-extensions-app. Do not modify. Used by AADB2C for storing user data.).

While running I am getting error :
"code": "Request_ResourceNotFound",
"message": "Resource 'SOME_GUID' does not exist or one of its queried reference-property objects are not present."

I am not sure what else I am missing here.

Thanks for you help.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,871 Reputation points Moderator
    2020-08-06T05:14:22.71+00:00

    Hello @Vikas Tiwari

    Based on the error message, it appears to be a problem with the object ID of the b2c-extensions-app. Make sure you have used object ID of the b2c-extensions-app and not the app ID (aka client ID) in your post call. If you are still facing any issues, please follow below steps as I have tested and confirmed that these steps successfully update the schema.

    1. Navigate to Azure Portal > Azure Active Directory > App Registration.
    2. Locate the b2c-extensions-app and copy the Object ID of the b2c-extensions-app.
    3. Open Graph Explorer by using https://developer.microsoft.com/en-us/graph/graph-explorer# url.
    4. Click on Sign in with Microsoft on the left and Sign in with Global Admin account who is a member of same directory and not added as external (guest) user.
    5. Click on Modify permissions > select Directory.AccessAsUser.All > click Modify Permissions.
    6. Click on Accept at consent page.
    7. In Graph Explorer, use following query. Where the < Tenant Name > is your_tenant.onmicrosoft.com in your case and < ObjectID of the application > is the value copied in Step 2.
      POST https://graph.microsoft.com/beta/< Tenant Name >/applications/< ObjectID of the application >/extensionProperties
    8. Use following text in the Request body. Since the targetObject is user, the attribute will be created for all Users in the tenant. Note: Please type the request body manually as with copy-paste Graph Explorer will not recognize some of the characters.
      {
      “name”: “employeeType”,
      “dataType”: “String”,
      “targetObjects”: [“User”]
      }
    9. To update the attribute with a value use following query:
      PATCH https://graph.microsoft.com/beta/users/your_globaladmin@your_tenant.onmicrosoft.com
      And use following Request Body:
      {
      "extension_e175b1fc21b144019cadxxxxxxxxxxxx_employeeType":"Value_to_be_assigned"
      }
    10. To verify if the attribute is updated successfully run following query:
      GET https://graph.microsoft.com/beta/users/ < User’s UPN or Object ID >

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information provided helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful

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.