Unable to either update or delete SchemaExtension

STJ 1 Reputation point
2021-06-12T07:59:15.47+00:00

Hello all,

Whenever we want to update or delete an schemaextension we get error.

When trying to delete the Schema we get next error:

104949-image.png

I use the same owner to delete it and status is still in development. Also the id i provide is correct, when i use the same id to get i get a schemaextension response.

Whenever i try to update de schema with the correct old properties etc, i get the following error:

105063-image.png

We use an registred app to create and update/delete the schema extensions.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,521 questions
{count} votes

2 answers

Sort by: Most helpful
  1. STJ 1 Reputation point
    2021-06-14T08:31:35.79+00:00

    For deleting we use the following endpoint/ code:

        public static async Task DeleteSchemaExtension(GraphServiceClient graphClient, string extensionId)
        {
          await graphClient.SchemaExtensions[extensionId].Request().DeleteAsync();
        }
    

    full error detail for delete:

    Microsoft.Graph.ServiceException: 'Code: UnknownError
    Message: Unable to find schema extension in AAD DB
    Inner error:
    AdditionalData:
    date: 2021-06-14T08:29:59
    request-id: e686a63a-2001-498f-a658-1d7f625106e8
    client-request-id: e686a63a-2001-498f-a658-1d7f625106e8
    ClientRequestId: e686a63a-2001-498f-a658-1d7f625106e8
    '

    For updating we use the following endpoint/code:

    public static async Task UpdateCasprSchemaExtension(GraphServiceClient graphClient, SchemaExtension extension)
    {
      SchemaExtension schemaExtension = new()
      {
        Description = "Caspr SchemaExtension",
        Owner = extension.Owner,
        Id = extension.Id,
        TargetTypes = new List<string>
        {
          "Event", "Group"
        },
        Properties = new List<ExtensionSchemaProperty>
        {
          new()
          {
            Name = "klasVakId",
            Type = "String"
          },
          new()
          {
            Name = "externalId",
            Type = "String"
          },
          new()
          {
            Name = "createdBy",
            Type = "String"
          }
        }
      };
      await graphClient.SchemaExtensions[extension.Id]
        .Request()
        .UpdateAsync(schemaExtension);
    }
    

    full error details for update:

    Microsoft.Graph.ServiceException: 'Code: Request_ResourceNotFound
    Message: Resource 'extlfyonjms_casprGroep' does not exist or one of its queried reference-property objects are not present.
    Inner error:
    AdditionalData:
    date: 2021-06-14T08:28:27
    request-id: 25fec5dd-8e03-4925-a3a3-eee7b868445a
    client-request-id: 25fec5dd-8e03-4925-a3a3-eee7b868445a
    ClientRequestId: 25fec5dd-8e03-4925-a3a3-eee7b868445a
    '

    0 comments No comments

  2. Dan Kershaw 416 Reputation points Microsoft Employee
    2021-07-06T14:08:48.08+00:00

    anonymous user-0882 sorry for the late response.
    Yes - this was a bug in the system that was introduced. This has since been hotfixed. Please try the operations again and let us know if it's fixed or still failing. Again - sorry for the issues that you were facing here.

    Hope this helps

    0 comments No comments