Synchronization.ReadWrite.All
Allows the application to configure the Azure AD synchronization service, without a signed-in user.
Permission Details
Read and write all Azure AD synchronization data.
Allows the application to configure the Azure AD synchronization service, without a signed-in user.
9b50c33d-700f-43b1-b2eb-87e89b703581
Read and write all Azure AD synchronization data
Allows the app to configure the Azure AD synchronization service, on behalf of the signed-in user.
7bb27fa3-ea8f-4d67-a916-87715b6188bd
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
id |
string |
The unique identifier for an entity. Read-only. |
jobs |
synchronizationJob collection |
Performs synchronization by periodically running in the background, polling for changes in one directory, and pushing them to another directory. |
secrets |
synchronizationSecretKeyStringValuePair collection |
Represents a collection of credentials to access provisioned cloud applications. |
templates |
synchronizationTemplate collection |
Preconfigured synchronization settings for a particular application. |
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"id": "String",
"jobs": [
{
"@type": "synchronizationJob",
"id": "00000000-0000-0000-0000-000000000000"
}
],
"secrets": [
{
"@type": "synchronizationSecretKeyStringValuePair",
"id": "00000000-0000-0000-0000-000000000000"
}
],
"templates": [
{
"@type": "synchronizationTemplate",
"id": "00000000-0000-0000-0000-000000000000"
}
]
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
jobs |
synchronizationJob collection |
Synchronization jobs configured for the resource. |
templates |
synchronizationTemplate collection |
Synchronization templates available for the resource. |
secrets |
synchronizationSecretKeyStringValuePair collection |
Represents a collection of credentials to access provisioned cloud applications. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.ServicePrincipals.Item.Synchronization.Secrets;
using Microsoft.Graph.Models;
var requestBody = new SecretsPutRequestBody
{
Value = new List<SynchronizationSecretKeyStringValuePair>
{
new SynchronizationSecretKeyStringValuePair
{
Key = SynchronizationSecret.BaseAddress,
Value = "[email protected]",
},
new SynchronizationSecretKeyStringValuePair
{
Key = SynchronizationSecret.SecretToken,
Value = "password-value",
},
new SynchronizationSecretKeyStringValuePair
{
Key = SynchronizationSecret.SyncNotificationSettings,
Value = "{\"Enabled\":false,\"DeleteThresholdEnabled\":false}",
},
new SynchronizationSecretKeyStringValuePair
{
Key = SynchronizationSecret.SyncAll,
Value = "false",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.ServicePrincipals["{servicePrincipal-id}"].Synchronization.Secrets.PutAsSecretsPutResponseAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const secrets = {
value: [
{
key: 'BaseAddress',
value: '[email protected]'
},
{
key: 'SecretToken',
value: 'password-value'
},
{
key: 'SyncNotificationSettings',
value: '{\"Enabled\':false,\'DeleteThresholdEnabled\':false}"
},
{
key: 'SyncAll',
value: 'false'
}
]
};
await client.api('/servicePrincipals/{id}/synchronization/secrets')
.put(secrets);
Import-Module Microsoft.Graph.Applications
$params = @{
value = @(
@{
key = "BaseAddress"
value = "[email protected]"
}
@{
key = "SecretToken"
value = "password-value"
}
@{
key = "SyncNotificationSettings"
value = '{"Enabled":false,"DeleteThresholdEnabled":false}'
}
@{
key = "SyncAll"
value = "false"
}
)
}
Set-MgServicePrincipalSynchronizationSecret -ServicePrincipalId $servicePrincipalId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.serviceprincipals.item.synchronization.secrets.secrets_put_request_body import SecretsPutRequestBody
from msgraph.generated.models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair
from msgraph.generated.models.synchronization_secret import SynchronizationSecret
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SecretsPutRequestBody(
value = [
SynchronizationSecretKeyStringValuePair(
key = SynchronizationSecret.BaseAddress,
value = "[email protected]",
),
SynchronizationSecretKeyStringValuePair(
key = SynchronizationSecret.SecretToken,
value = "password-value",
),
SynchronizationSecretKeyStringValuePair(
key = SynchronizationSecret.SyncNotificationSettings,
value = "{\"Enabled\":false,\"DeleteThresholdEnabled\":false}",
),
SynchronizationSecretKeyStringValuePair(
key = SynchronizationSecret.SyncAll,
value = "false",
),
],
)
result = await graph_client.service_principals.by_service_principal_id('servicePrincipal-id').synchronization.secrets.put(request_body)
App Registration
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions or delegated permissions and search for Synchronization.ReadWrite.All
Grant Admin Consent
Application permissions always require admin consent.