Compartir a través de


az sql instance-failover-group-arc

Note

This reference is part of the arcdata extension for the Azure CLI (version 2.3.1 or higher). The extension will automatically install the first time you run an az sql instance-failover-group-arc command. Learn more about extensions.

Manage Arc-enabled SQL managed instance Failover Groups.

Commands

Name Description Type Status
az sql instance-failover-group-arc create

Create a failover group resource.

Extension GA
az sql instance-failover-group-arc delete

Delete an Arc-enabled SQL Managed Instance failover group.

Extension GA
az sql instance-failover-group-arc list

List all failover groups.

Extension GA
az sql instance-failover-group-arc show

Show the details of a failover group resource.

Extension GA
az sql instance-failover-group-arc update

Update a failover group resource.

Extension GA

az sql instance-failover-group-arc create

Create a failover group resource.

Create an Arc-enabled SQL Managed Instance failover group resource to set up a distributed availability group.

az sql instance-failover-group-arc create --mi
                                          --name
                                          --partner-mi
                                          [--k8s-namespace]
                                          [--no-wait]
                                          [--partner-mirroring-cert-file]
                                          [--partner-mirroring-url]
                                          [--partner-resource-group]
                                          [--partner-sync-mode {async, sync}]
                                          [--primary-mirroring-url]
                                          [--resource-group]
                                          [--role {primary, secondary}]
                                          [--shared-name]
                                          [--use-k8s]

Examples

Use the Kubernetes API to create a failover group resource between primary SQL managed instance sqlmi1 and partner SQL managed instance sqlmi2.The partner mirroring endpoint and cert file are required.

az sql instance-failover-group-arc create --name fogcr --shared-name sharedname1 --mi sqlmi1 --role primary --partner-mi sqlmi2 --partner-mirroring-url 10.20.5.20:970 --partner-mirroring-cert-file ./sqlmi2.cer --use-k8s

Use Azure Resource Manager (ARM) to create a failover group resource.

az sql instance-failover-group-arc create --name fogcr  --mi sqlmi1 --resource-group primary-rg-name  --partner-mi sqlmi2 --partner-resource-group partner-rg-name --partner-sync-mode async

Use ARM to create a failover group with custom mirroring URLs.

az sql instance-failover-group-arc create --name fogcr  --mi sqlmi1 --resource-group primary-rg-name  --partner-mi sqlmi2 --partner-resource-group partner-rg-name --partner-sync-mode async --primary-mirroring-url 21.10.6.30:6603 --partner-mirroring-url 10.20.5.20:970

Required Parameters

--mi

The name of the primary SQL managed instance.

--name -n

The name of the failover group resource.

--partner-mi

The name of the partner SQL managed instance or remote SQL instance. When using ARM-targeted arguments, this refers to the Disaster Recovery (DR) instance name.

Optional Parameters

--k8s-namespace -k

Namespace where the failover group is to be deployed. If no namespace is specified, then the namespace defined in the kubeconfig will be used.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--partner-mirroring-cert-file -f

The filename of mirroring endpoint public certificate for the partner SQL managed instance or availability group on remote SQL instance. Only PEM format is supported.

--partner-mirroring-url -u

The mirroring endpoint URL of the partner SQL managed instance.

--partner-resource-group

The Azure resource group of the DR partner Arc-enabled SQL managed instance.

--partner-sync-mode -m

The partner synchronization mode of the Arc-enabled SQL managed instance.

Accepted values: async, sync
--primary-mirroring-url

The mirroring endpoint URL of the primary SQL managed instance.

--resource-group -g

The Azure resource group of the primary Arc-enabled SQL managed instance.

--role

The requested role of the failover group. The role can be changed.

Accepted values: primary, secondary
--shared-name

The shared name of the failover group for this SQL managed instance. Both the primary SQL managed instance and its partner must use the same shared name.

--use-k8s

Create the Arc-enabled SQL managed instance failover group using local Kubernetes APIs.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql instance-failover-group-arc delete

Delete an Arc-enabled SQL Managed Instance failover group.

az sql instance-failover-group-arc delete --name
                                          [--k8s-namespace]
                                          [--mi]
                                          [--resource-group]
                                          [--use-k8s]

Examples

Delete a failover group resource using the Kubernetes API.

az sql instance-failover-group-arc delete --name fogcr --use-k8s

Delete a failover group resource using Azure Resource Manager.

az sql instance-failover-group-arc delete --name fogcr --mi sqlmi1 -g rg-name

Required Parameters

--name -n

The name of the failover group resource to delete.

Optional Parameters

--k8s-namespace -k

Namespace where the failover group is deployed. If no namespace is specified, then the namespace defined in the kubeconfig will be used.

--mi

The name of the primary Arc-enabled SQL managed instance.

--resource-group -g

The Azure resource group of the primary Arc-enabled SQL managed instance.

--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql instance-failover-group-arc list

List all failover groups.

az sql instance-failover-group-arc list [--k8s-namespace]
                                        [--mi]
                                        [--resource-group]
                                        [--use-k8s]

Examples

List all failover groups in a namespace using the Kubernetes API.

az sql instance-failover-group-arc list --k8s-namespace arcdata --use-k8s

List all failover groups by querying Azure Resource Manager (ARM).

az sql instance-failover-group-arc list --mi sqlmi1 -g rg-name

Optional Parameters

--k8s-namespace -k

Namespace where the failover groups are deployed. If no namespace is specified, then the namespace defined in the kubeconfig will be used.

--mi

The name of the Arc-enabled SQL managed instance.

--resource-group -g

The Azure resource group of the Arc-enabled SQL managed instance.

--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql instance-failover-group-arc show

Show the details of a failover group resource.

az sql instance-failover-group-arc show --name
                                        [--k8s-namespace]
                                        [--mi]
                                        [--resource-group]
                                        [--use-k8s]

Examples

Show the details of a failover group using the Kubernetes API.

az sql instance-failover-group-arc show --name fogcr --use-k8s

Show the details of a failover group by querying Azure Resource Manager (ARM).

az sql instance-failover-group-arc show --name fogcr1 --mi sqlmi1 -g rg-name

Required Parameters

--name -n

The name of the failover group resource.

Optional Parameters

--k8s-namespace -k

Namespace where the failover group is deployed. If no namespace is specified, then the namespace defined in the kubeconfig will be used.

--mi

The name of the primary Arc-enabled SQL managed instance.

--resource-group -g

The Azure resource group of the primary Arc-enabled SQL managed instance.

--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql instance-failover-group-arc update

Update a failover group resource.

Update an Arc-enabled SQL Managed Instance failover group resource to change the role of the distributed availability group.

az sql instance-failover-group-arc update --name
                                          [--k8s-namespace]
                                          [--mi]
                                          [--no-wait]
                                          [--partner-sync-mode {async, sync}]
                                          [--resource-group]
                                          [--role {force-primary-allow-data-loss, force-secondary, secondary}]
                                          [--use-k8s]

Examples

Update a failover group resource to the secondary role from primary using the Kubernetes API.

az sql instance-failover-group-arc update --name fogcr --role secondary --use-k8s

Update a failover group resource using Azure Resource Manager.

az sql instance-failover-group-arc update --name fogcr  --role secondary --mi sqlmi1 --resource-group rg-name

Required Parameters

--name -n

The name of the failover group resource.

Optional Parameters

--k8s-namespace -k

Namespace where the failover group exists. If no namespace is specified, then the namespace defined in the kubeconfig will be used.

--mi

The name of the Arc-enabled SQL managed instance to update.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--partner-sync-mode -m

The partner synchronization mode of the SQL managed instance.

Accepted values: async, sync
--resource-group -g

The Azure resource group of the primary Arc-enabled SQL managed instance.

--role

The requested role of the failover group.

Accepted values: force-primary-allow-data-loss, force-secondary, secondary
--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.