Share via


az sql vm group ag-listener

Manage SQL availability group listeners.

Commands

Name Description Type Status
az sql vm group ag-listener create

Creates an availability group listener.

Core GA
az sql vm group ag-listener delete

Deletes an availability group listener.

Core GA
az sql vm group ag-listener list

Lists all availability group listeners in a SQL virtual machine group.

Core GA
az sql vm group ag-listener show

Gets an availability group listener.

Core GA
az sql vm group ag-listener update

Updates an availability group listener.

Core GA

az sql vm group ag-listener create

Creates an availability group listener.

az sql vm group ag-listener create --ag-name
                                   --group-name
                                   --ip-address
                                   --load-balancer
                                   --name
                                   --probe-port
                                   --resource-group
                                   --sqlvms
                                   --subnet
                                   [--port]
                                   [--public-ip]
                                   [--vnet-name]

Examples

Create an availability group listener. Note the SQL virtual machines are in the same resource group as the SQL virtual machine group.

az sql vm group ag-listener create -n aglistenertest -g myresourcegroup --ag-name agname --group-name sqlvmgroup --ip-address 10.0.0.11 --load-balancer '/subscriptions/{yoursubscription}/resourceGroups/{yourrg}/providers/Microsoft.Network/loadBalancers/{lbname}' --probe-port 59999 --subnet '/subscriptions/{yoursubscription}/resourceGroups/{yourrg}/providers/Microsoft.Network/virtualNetworks/{vnname}/subnets/{subnetname}' --sqlvms sqlvm1 sqlvm2

Create an availability group listener. Note all resources are in the same resource group.

az sql vm group ag-listener create -n aglistenertest -g myresourcegroup --ag-name agname --group-name sqlvmgroup --ip-address 10.0.0.11 --load-balancer {lbname} --probe-port 59999 --subnet {subnetname} --vnet-name {vnname} --sqlvms sqlvm1 sqlvm2

Required Parameters

--ag-name -a
--group-name -r

Name of the SQL virtual machine group.

--ip-address -i

Private IP address bound to the availability group listener.

Property Value
Parameter group: Load Balancer Configuration Arguments
--load-balancer -b

Name or resource ID of the load balancer.

Property Value
Parameter group: Load Balancer Configuration Arguments
--name -n

Name of the availability group listener.

--probe-port -e

Probe port.

Property Value
Parameter group: Load Balancer Configuration Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--sqlvms -q

Space-separated list of SQL virtual machine instance name or resource IDs that are enrolled into the availability group.

Property Value
Parameter group: Load Balancer Configuration Arguments
--subnet -u

The name or resource id of the subnet to include in the private IP.

Property Value
Parameter group: Load Balancer Configuration Arguments

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--port -p

Listener port.

Property Value
Parameter group: SQL Connectivity Update Settings Arguments
Default value: 1433
--public-ip -c

Name or resource ID of the public IP.

Property Value
Parameter group: Load Balancer Configuration Arguments
--vnet-name

Name of the virtual network. Provide only if name of the subnet has been provided.

Property Value
Parameter group: Load Balancer Configuration Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az sql vm group ag-listener delete

Deletes an availability group listener.

az sql vm group ag-listener delete --group-name
                                   [--ids]
                                   [--name]
                                   [--resource-group]
                                   [--subscription]
                                   [--yes]

Required Parameters

--group-name -r

Name of the SQL virtual machine group.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the availability group listener.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az sql vm group ag-listener list

Lists all availability group listeners in a SQL virtual machine group.

az sql vm group ag-listener list --group-name
                                 --resource-group

Required Parameters

--group-name -r

Name of the SQL virtual machine group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az sql vm group ag-listener show

Gets an availability group listener.

az sql vm group ag-listener show --group-name
                                 [--expand {*, AssessmentSettings, AutoBackupSettings, AutoPatchingSettings, KeyVaultCredentialSettings, ServerConfigurationsManagementSettings}]
                                 [--ids]
                                 [--name]
                                 [--resource-group]
                                 [--subscription]

Required Parameters

--group-name -r

Name of the SQL virtual machine group.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--expand

Get the SQLIaaSExtension configuration settings. To view all settings, use *. To select only a few, the settings must be space-separated.

Property Value
Accepted values: *, AssessmentSettings, AutoBackupSettings, AutoPatchingSettings, KeyVaultCredentialSettings, ServerConfigurationsManagementSettings
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the availability group listener.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az sql vm group ag-listener update

Updates an availability group listener.

az sql vm group ag-listener update --group-name
                                   [--add]
                                   [--force-string]
                                   [--ids]
                                   [--name]
                                   [--remove]
                                   [--resource-group]
                                   [--set]
                                   [--sqlvms]
                                   [--subscription]

Examples

Replace the SQL virtual machines that were in the availability group.

az sql vm group ag-listener update -n aglistenertest -g myresourcegroup --sqlvms sqlvm3 sqlvm4 --group-name mygroup

Required Parameters

--group-name -r

Name of the SQL virtual machine group.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Property Value
Parameter group: Generic Update Arguments
Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the availability group listener.

Property Value
Parameter group: Resource Id Arguments
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--sqlvms -q

Space-separated list of SQL virtual machine instance name or resource IDs that are enrolled into the availability group.

Property Value
Parameter group: Load Balancer Configuration Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False