Skip to main content

distributed_availability_groups

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

Overview

Namedistributed_availability_groups
TypeResource
Idazure.sql.distributed_availability_groups

Fields

NameDatatypeDescription
distributedAvailabilityGroupNametextfield from the properties object
distributed_availability_group_idtextfield from the properties object
last_hardened_lsntextfield from the properties object
link_statetextfield from the properties object
managedInstanceNametextfield from the properties object
primary_availability_group_nametextfield from the properties object
replication_modetextfield from the properties object
resourceGroupNametextfield from the properties object
secondary_availability_group_nametextfield from the properties object
source_endpointtextfield from the properties object
source_replica_idtextfield from the properties object
subscriptionIdtextfield from the properties object
target_databasetextfield from the properties object
target_replica_idtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdistributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionIdGets a distributed availability group info.
create_or_updateINSERTdistributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionIdCreates a distributed availability group between Sql On-Prem and Sql Managed Instance.
deleteDELETEdistributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionIdDrops a distributed availability group between Sql On-Prem and Sql Managed Instance.
updateUPDATEdistributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionIdUpdates a distributed availability group replication mode.

SELECT examples

Gets a distributed availability group info.

SELECT
distributedAvailabilityGroupName,
distributed_availability_group_id,
last_hardened_lsn,
link_state,
managedInstanceName,
primary_availability_group_name,
replication_mode,
resourceGroupName,
secondary_availability_group_name,
source_endpoint,
source_replica_id,
subscriptionId,
target_database,
target_replica_id
FROM azure.sql.vw_distributed_availability_groups
WHERE distributedAvailabilityGroupName = '{{ distributedAvailabilityGroupName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.sql.distributed_availability_groups (
distributedAvailabilityGroupName,
managedInstanceName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ distributedAvailabilityGroupName }}',
'{{ managedInstanceName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

UPDATE example

Updates a distributed_availability_groups resource.

/*+ update */
UPDATE azure.sql.distributed_availability_groups
SET
properties = '{{ properties }}'
WHERE
distributedAvailabilityGroupName = '{{ distributedAvailabilityGroupName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified distributed_availability_groups resource.

/*+ delete */
DELETE FROM azure.sql.distributed_availability_groups
WHERE distributedAvailabilityGroupName = '{{ distributedAvailabilityGroupName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';