Skip to main content

sql_server_availability_groups

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

Overview

Namesql_server_availability_groups
TypeResource
Idazure.azure_arc_data.sql_server_availability_groups

Fields

NameDatatypeDescription
availabilityGroupNametextfield from the properties object
availability_group_idtextfield from the properties object
collection_timestamptextfield from the properties object
databasestextfield from the properties object
infotextfield from the properties object
instance_nametextfield from the properties object
locationtextThe geo-location where the resource lives
provisioning_statetextfield from the properties object
replicastextfield from the properties object
resourceGroupNametextfield from the properties object
server_nametextfield from the properties object
sqlServerInstanceNametextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.

Methods

NameAccessible byRequired ParamsDescription
getSELECTavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionIdRetrieves an Arc Sql Server availability group.
listSELECTresourceGroupName, sqlServerInstanceName, subscriptionId
createINSERTavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId, data__propertiesCreates or replaces an Arc Sql Server Availability Group.
deleteDELETEavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionIdDeletes an Arc Sql Server availability group resource.
updateUPDATEavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionIdUpdates an existing Availability Group.
detail_viewEXECavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionIdRetrieves detailed properties of the Availability Group.
failoverEXECavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionIdRequest manual failover of the availability group to this server.
force_failover_allow_data_lossEXECavailabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionIdRequest forced failover of the availability group to this server.

SELECT examples

SELECT
availabilityGroupName,
availability_group_id,
collection_timestamp,
databases,
info,
instance_name,
location,
provisioning_state,
replicas,
resourceGroupName,
server_name,
sqlServerInstanceName,
subscriptionId,
tags
FROM azure.azure_arc_data.vw_sql_server_availability_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.azure_arc_data.sql_server_availability_groups (
availabilityGroupName,
resourceGroupName,
sqlServerInstanceName,
subscriptionId,
data__properties,
tags,
location,
properties
)
SELECT
'{{ availabilityGroupName }}',
'{{ resourceGroupName }}',
'{{ sqlServerInstanceName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ tags }}',
'{{ location }}',
'{{ properties }}'
;

UPDATE example

Updates a sql_server_availability_groups resource.

/*+ update */
UPDATE azure.azure_arc_data.sql_server_availability_groups
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
availabilityGroupName = '{{ availabilityGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified sql_server_availability_groups resource.

/*+ delete */
DELETE FROM azure.azure_arc_data.sql_server_availability_groups
WHERE availabilityGroupName = '{{ availabilityGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';