Sync Agents - Create Or Update
Creates or updates a sync agent.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}?api-version=2023-08-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
|
server
|
path | True |
string |
The name of the server on which the sync agent is hosted. |
|
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
|
sync
|
path | True |
string |
The name of the sync agent. |
|
api-version
|
query | True |
string |
The API version to use for the request. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties.syncDatabaseId |
string |
ARM resource id of the sync database in the sync agent. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Successfully updated the sync agent. |
|
| 201 Created |
Successfully created the sync agent. |
|
| 202 Accepted |
Creating or updating the sync agent is in progress. Headers Location: string |
|
| Other Status Codes |
*** Error Responses: ***
|
Examples
| Create a new sync agent |
| Update a sync agent |
Create a new sync agent
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncagentcrud-65440/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187?api-version=2023-08-01
{
"properties": {
"syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"
}
}
Sample response
{
"properties": {
"syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync",
"state": "NeverConnected",
"isUpToDate": true,
"expiryTime": "9999-12-31T23:59:59.9999999Z",
"version": "4.2.0.0"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187",
"name": "syncagent",
"type": "Microsoft.Sql/servers/syncAgents"
}
{
"properties": {
"syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync",
"state": "NeverConnected",
"isUpToDate": true,
"expiryTime": "9999-12-31T23:59:59.9999999Z",
"version": "4.2.0.0"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187",
"name": "syncagent",
"type": "Microsoft.Sql/servers/syncAgents"
}
Update a sync agent
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncagentcrud-65440/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187?api-version=2023-08-01
{
"properties": {
"syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"
}
}
Sample response
{
"properties": {
"syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync",
"state": "NeverConnected",
"isUpToDate": true,
"expiryTime": "9999-12-31T23:59:59.9999999Z",
"version": "4.2.0.0"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187",
"name": "syncagent",
"type": "Microsoft.Sql/servers/syncAgents"
}
{
"properties": {
"syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync",
"state": "NeverConnected",
"isUpToDate": true,
"expiryTime": "9999-12-31T23:59:59.9999999Z",
"version": "4.2.0.0"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187",
"name": "syncagent",
"type": "Microsoft.Sql/servers/syncAgents"
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/westus/operation/00000000-1111-2222-3333-444444444444?api-version=2022-11-01-preview
Definitions
| Name | Description |
|---|---|
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Sync |
An Azure SQL Database sync agent. |
|
Sync |
State of the sync agent. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
SyncAgent
An Azure SQL Database sync agent.
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| name |
string |
Resource name. |
| properties.expiryTime |
string (date-time) |
Expiration time of the sync agent version. |
| properties.isUpToDate |
boolean |
If the sync agent version is up to date. |
| properties.lastAliveTime |
string (date-time) |
Last alive time of the sync agent. |
| properties.name |
string |
Name of the sync agent. |
| properties.state |
State of the sync agent. |
|
| properties.syncDatabaseId |
string |
ARM resource id of the sync database in the sync agent. |
| properties.version |
string |
Version of the sync agent. |
| type |
string |
Resource type. |
SyncAgentState
State of the sync agent.
| Value | Description |
|---|---|
| Online | |
| Offline | |
| NeverConnected |