Skip to main content

failover_groups

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

Overview

Namefailover_groups
TypeResource
Idazure.sql.failover_groups

Fields

NameDatatypeDescription
databasestextfield from the properties object
failoverGroupNametextfield from the properties object
locationtextResource location.
partner_serverstextfield from the properties object
read_only_endpointtextfield from the properties object
read_write_endpointtextfield from the properties object
replication_roletextfield from the properties object
replication_statetextfield from the properties object
resourceGroupNametextfield from the properties object
secondary_typetextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.

Methods

NameAccessible byRequired ParamsDescription
getSELECTfailoverGroupName, resourceGroupName, serverName, subscriptionIdGets a failover group.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdLists the failover groups in a server.
create_or_updateINSERTfailoverGroupName, resourceGroupName, serverName, subscriptionIdCreates or updates a failover group.
deleteDELETEfailoverGroupName, resourceGroupName, serverName, subscriptionIdDeletes a failover group.
updateUPDATEfailoverGroupName, resourceGroupName, serverName, subscriptionIdUpdates a failover group.
failoverEXECfailoverGroupName, resourceGroupName, serverName, subscriptionIdFails over from the current primary server to this server.
force_failover_allow_data_lossEXECfailoverGroupName, resourceGroupName, serverName, subscriptionIdFails over from the current primary server to this server. This operation might result in data loss.
try_planned_before_forced_failoverEXECfailoverGroupName, resourceGroupName, serverName, subscriptionIdFails over from the current primary server to this server. This operation tries planned before forced failover but might still result in data loss.

SELECT examples

Lists the failover groups in a server.

SELECT
databases,
failoverGroupName,
location,
partner_servers,
read_only_endpoint,
read_write_endpoint,
replication_role,
replication_state,
resourceGroupName,
secondary_type,
serverName,
subscriptionId,
tags
FROM azure.sql.vw_failover_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

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

UPDATE example

Updates a failover_groups resource.

/*+ update */
UPDATE azure.sql.failover_groups
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
failoverGroupName = '{{ failoverGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified failover_groups resource.

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