instance_failover_groups
Creates, updates, deletes, gets or lists an instance_failover_groups resource.
Overview
| Name | instance_failover_groups |
| Type | Resource |
| Id | azure.sql.instance_failover_groups |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_location
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
managedInstancePairs | array | List of managed instance pairs in the failover group. Required. |
partnerRegions | array | Partner region information for the failover group. Required. |
readOnlyEndpoint | object | Read-only endpoint of the failover group instance. |
readWriteEndpoint | object | Read-write endpoint of the failover group instance. Required. |
replicationRole | string | Local replication role of the failover group instance. Known values are: "Primary" and "Secondary". (Primary, Secondary) |
replicationState | string | Replication state of the failover group instance. |
secondaryType | string | Type 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) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
managedInstancePairs | array | List of managed instance pairs in the failover group. Required. |
partnerRegions | array | Partner region information for the failover group. Required. |
readOnlyEndpoint | object | Read-only endpoint of the failover group instance. |
readWriteEndpoint | object | Read-write endpoint of the failover group instance. Required. |
replicationRole | string | Local replication role of the failover group instance. Known values are: "Primary" and "Secondary". (Primary, Secondary) |
replicationState | string | Replication state of the failover group instance. |
secondaryType | string | Type 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) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
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.
| Name | Datatype | Description |
|---|---|---|
failover_group_name | string | The name of the failover group. Required. |
location_name | string | The name of the region where the resource is located. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_location
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
;
Lists the failover groups in a location.
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 subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: instance_failover_groups
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the instance_failover_groups resource.
- name: location_name
value: "{{ location_name }}"
description: Required parameter for the instance_failover_groups resource.
- name: failover_group_name
value: "{{ failover_group_name }}"
description: Required parameter for the instance_failover_groups resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the instance_failover_groups resource.
- name: properties
description: |
Resource properties.
value:
secondaryType: "{{ secondaryType }}"
readWriteEndpoint:
failoverPolicy: "{{ failoverPolicy }}"
failoverWithDataLossGracePeriodMinutes: {{ failoverWithDataLossGracePeriodMinutes }}
readOnlyEndpoint:
failoverPolicy: "{{ failoverPolicy }}"
replicationRole: "{{ replicationRole }}"
replicationState: "{{ replicationState }}"
partnerRegions:
- location: "{{ location }}"
replicationRole: "{{ replicationRole }}"
managedInstancePairs:
- primaryManagedInstanceId: "{{ primaryManagedInstanceId }}"
partnerManagedInstanceId: "{{ partnerManagedInstanceId }}"
REPLACE examples
- create_or_update
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
- delete
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
- failover
- force_failover_allow_data_loss
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
;
Fails over from the current primary managed instance to this managed instance. This operation might result in data loss.
EXEC azure.sql.instance_failover_groups.force_failover_allow_data_loss
@resource_group_name='{{ resource_group_name }}' --required,
@location_name='{{ location_name }}' --required,
@failover_group_name='{{ failover_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;