Skip to main content

instance_failover_groups

Creates, updates, deletes, gets or lists an instance_failover_groups resource.

Overview

Nameinstance_failover_groups
TypeResource
Idazure.sql.instance_failover_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
managedInstancePairsarrayList of managed instance pairs in the failover group. Required.
partnerRegionsarrayPartner region information for the failover group. Required.
readOnlyEndpointobjectRead-only endpoint of the failover group instance.
readWriteEndpointobjectRead-write endpoint of the failover group instance. Required.
replicationRolestringLocal replication role of the failover group instance. Known values are: "Primary" and "Secondary". (Primary, Secondary)
replicationStatestringReplication state of the failover group instance.
secondaryTypestringType of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only. Known values are: "Geo" and "Standby". (Geo, Standby)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, location_name, failover_group_name, subscription_idGets a failover group.
list_by_locationselectresource_group_name, location_name, subscription_idLists the failover groups in a location.
create_or_updateinsertresource_group_name, location_name, failover_group_name, subscription_idCreates or updates a failover group.
create_or_updatereplaceresource_group_name, location_name, failover_group_name, subscription_idCreates or updates a failover group.
deletedeleteresource_group_name, location_name, failover_group_name, subscription_idDeletes a failover group.
failoverexecresource_group_name, location_name, failover_group_name, subscription_idFails over from the current primary managed instance to this managed instance.
force_failover_allow_data_lossexecresource_group_name, location_name, failover_group_name, subscription_idFails over from the current primary managed instance to this managed instance. This operation might result in data loss.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
failover_group_namestringThe name of the failover group. Required.
location_namestringThe name of the region where the resource is located. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets a failover group.

SELECT
id,
name,
managedInstancePairs,
partnerRegions,
readOnlyEndpoint,
readWriteEndpoint,
replicationRole,
replicationState,
secondaryType,
systemData,
type
FROM azure.sql.instance_failover_groups
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND location_name = '{{ location_name }}' -- required
AND failover_group_name = '{{ failover_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a failover group.

INSERT INTO azure.sql.instance_failover_groups (
properties,
resource_group_name,
location_name,
failover_group_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ location_name }}',
'{{ failover_group_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Creates or updates a failover group.

REPLACE azure.sql.instance_failover_groups
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND location_name = '{{ location_name }}' --required
AND failover_group_name = '{{ failover_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Deletes a failover group.

DELETE FROM azure.sql.instance_failover_groups
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND location_name = '{{ location_name }}' --required
AND failover_group_name = '{{ failover_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Fails over from the current primary managed instance to this managed instance.

EXEC azure.sql.instance_failover_groups.failover 
@resource_group_name='{{ resource_group_name }}' --required,
@location_name='{{ location_name }}' --required,
@failover_group_name='{{ failover_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;