Share via

Update application synchronization template Internal Error(500)

Diego Gobbetti (IT) 20 Reputation points
2025-03-12T13:57:01.1066667+00:00

I am trying to update a custom application synchronization template using the endpoint exposed by the Graph API 'https://graph.microsoft.com/v1.0/applications/{id}/synchronization/templates/{templateId}' as specified here https://learn.microsoft.com/en-us/graph/api/synchronization-synchronizationtemplate-update?view=graph-rest-1.0&tabs=http

Following the instructions provided at that page, I get in response an Internal Error(500).
Troubleshooting it, I tried several kind of requests among which both API versions(beta, v1.0), another gallery-available app template. In most of the requests I am not even updating any field, taking data from the specular GET request, and filling the following template :
{

"applicationId": "String (identifier)",

"default": true,

"description": "String",

"discoverable": true,

"factoryTag": "String",

"id": "String (identifier)",

"metadata": [

{

  "key":"xxxx",

 "value": "xxxx"

}

],

"schema": {

"id": "xxxxx",

"version": "xxx",

"synchronizationRules": [<syncRulesCopiedFromGetRequest>],

"directories" : [<directoriesCopiedFromGetRequest>]

}

}

---> always get 500 internal error

Whereas when I try to add odata.type annotation to request body fields, as instructed in the relative resources documentation pages
https://learn.microsoft.com/en-us/graph/api/resources/synchronization-synchronizationmetadataentry?view=graph-rest-1.0
https://learn.microsoft.com/en-us/graph/api/resources/synchronization-synchronizationschema?view=graph-rest-1.0
so using the following template

{

"applicationId": "String (identifier)",

"default": true,

"description": "String",

"discoverable": true,

"factoryTag": "String",

"id": "String (identifier)",

"metadata": [

{

  "@odata.type": "microsoft.graph.synchronizationMetadataEntry",  
  "key":"xxxx",

 "value": "xxxx"

}

],

"schema": {

"@odata.type": "microsoft.graph.synchronizationSchema"

}

}

I get 406 response with the following code and message :
"message": "template : A type named 'microsoft.synchronization.synchronizationMetadataEntry' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.",
"code": "RequestParameterInvalid",

Which, seems like it resolves the declared type 'microsoft.graph.synchronizationSchema' to 'microsoft.synchronization.synchronizationMetadataEntry', which does not exists

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-03-18T11:24:09.1233333+00:00

    Hi Diego Gobbetti (IT),

    Thank you for posting your query on Microsoft Q&A.

    Based on your query, I understand you are not able to update the synchronization template using the provided public documents.

    The error: 406 means This service doesn’t support the format requested in the Accept header.

    The header you have provided is not acceptable. Based on this error, I believe you need to make sure to provide the content type as Application/json and Authorization as Bearer.

    The odata type which resolves to metadata has to be provided with Key and Value. These values have to be provided in Request headers and here is the support list of key value pairs: Supported key-value pairs.

    As you are updating the template, I believe you are using PUT or PATCH to query the API calls. These are the above parameters which would help you in resolving the issue.

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    If the answer is helpful, please click "Accept Answer" and kindly "upvote it". If you have extra questions about this answer, please click "Comment".

    Was this answer helpful?


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.