az sql vm group ag-listener

Manage SQL availability group listeners.

Commands

az sql vm group ag-listener create Creates an availability group listener.
az sql vm group ag-listener delete Deletes an availability group listener.
az sql vm group ag-listener list Lists all availability group listeners in a SQL virtual machine group.
az sql vm group ag-listener show Gets an availability group listener.
az sql vm group ag-listener update Updates an availability group listener.

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]
[--subscription]
[--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.

--load-balancer -b

Name or resource ID of the load balancer.

--name -n

Name of the availability group listener.

--probe-port -e

Probe port.

--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.

--subnet -u

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

Optional Parameters

--port -p

Listener port.

default value: 1433
--public-ip -c

Name or resource ID of the public IP.

--subscription

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

--vnet-name

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

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

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the availability group listener.

--resource-group -g

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

--subscription

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

--yes -y

Do not prompt for confirmation.

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
[--subscription]

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>.

Optional Parameters

--subscription

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

az sql vm group ag-listener show

Gets an availability group listener.

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

Required Parameters

--group-name -r

Name of the SQL virtual machine group.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the availability group listener.

--resource-group -g

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

--subscription

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

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

--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>.

--force-string

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

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the availability group listener.

--remove

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

--resource-group -g

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

--set

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

--sqlvms -q

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

--subscription

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