distributed_availability_groups
Creates, updates, deletes, gets or lists a distributed_availability_groups
resource.
Overview
Name | distributed_availability_groups |
Type | Resource |
Id | azure.sql.distributed_availability_groups |
Fields
- vw_distributed_availability_groups
- distributed_availability_groups
Name | Datatype | Description |
---|---|---|
distributedAvailabilityGroupName | text | field from the properties object |
distributed_availability_group_id | text | field from the properties object |
last_hardened_lsn | text | field from the properties object |
link_state | text | field from the properties object |
managedInstanceName | text | field from the properties object |
primary_availability_group_name | text | field from the properties object |
replication_mode | text | field from the properties object |
resourceGroupName | text | field from the properties object |
secondary_availability_group_name | text | field from the properties object |
source_endpoint | text | field from the properties object |
source_replica_id | text | field from the properties object |
subscriptionId | text | field from the properties object |
target_database | text | field from the properties object |
target_replica_id | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a distributed availability group. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | distributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionId | Gets a distributed availability group info. |
create_or_update | INSERT | distributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionId | Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. |
delete | DELETE | distributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionId | Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. |
update | UPDATE | distributedAvailabilityGroupName, managedInstanceName, resourceGroupName, subscriptionId | Updates a distributed availability group replication mode. |
SELECT
examples
Gets a distributed availability group info.
- vw_distributed_availability_groups
- distributed_availability_groups
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 }}';
SELECT
properties
FROM azure.sql.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.distributed_availability_groups (
distributedAvailabilityGroupName,
managedInstanceName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ distributedAvailabilityGroupName }}',
'{{ managedInstanceName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: targetDatabase
value: string
- name: sourceEndpoint
value: string
- name: primaryAvailabilityGroupName
value: string
- name: secondaryAvailabilityGroupName
value: string
- name: replicationMode
value: string
- name: distributedAvailabilityGroupId
value: string
- name: sourceReplicaId
value: string
- name: targetReplicaId
value: string
- name: linkState
value: string
- name: lastHardenedLsn
value: string
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 }}';