Skip to main content

sync_agents

Creates, updates, deletes, gets or lists a sync_agents resource.

Overview

Namesync_agents
TypeResource
Idazure.sql.sync_agents

Fields

NameDatatypeDescription
nametextfield from the properties object
expiry_timetextfield from the properties object
is_up_to_datetextfield from the properties object
last_alive_timetextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
statetextfield from the properties object
subscriptionIdtextfield from the properties object
syncAgentNametextfield from the properties object
sync_database_idtextfield from the properties object
versiontextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, serverName, subscriptionId, syncAgentNameGets a sync agent.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdLists sync agents in a server.
create_or_updateINSERTresourceGroupName, serverName, subscriptionId, syncAgentNameCreates or updates a sync agent.
deleteDELETEresourceGroupName, serverName, subscriptionId, syncAgentNameDeletes a sync agent.
generate_keyEXECresourceGroupName, serverName, subscriptionId, syncAgentNameGenerates a sync agent key.

SELECT examples

Lists sync agents in a server.

SELECT
name,
expiry_time,
is_up_to_date,
last_alive_time,
resourceGroupName,
serverName,
state,
subscriptionId,
syncAgentName,
sync_database_id,
version
FROM azure.sql.vw_sync_agents
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new sync_agents resource.

/*+ create */
INSERT INTO azure.sql.sync_agents (
resourceGroupName,
serverName,
subscriptionId,
syncAgentName,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ syncAgentName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified sync_agents resource.

/*+ delete */
DELETE FROM azure.sql.sync_agents
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND syncAgentName = '{{ syncAgentName }}';