az mysql flexible-server firewall-rule

Manage firewall rules for a server.

Commands

az mysql flexible-server firewall-rule create

Create a new firewall rule for a flexible server.

az mysql flexible-server firewall-rule delete

Delete a firewall rule.

az mysql flexible-server firewall-rule list

List all firewall rules for a flexible server.

az mysql flexible-server firewall-rule show

Get the details of a firewall rule.

az mysql flexible-server firewall-rule update

Update a firewall rule.

az mysql flexible-server firewall-rule create

Create a new firewall rule for a flexible server.

az mysql flexible-server firewall-rule create --end-ip-address
                                              --name
                                              --resource-group
                                              --server-name
                                              --start-ip-address
                                              [--subscription]

Examples

Create a firewall rule allowing connections from a specific IP address.

az mysql flexible-server firewall-rule create --resource-group testGroup --server-name testServer --name allowip --start-ip-address 107.46.14.221 --end-ip-address 107.46.14.221

Create a firewall rule allowing connections from an IP address range.

az mysql flexible-server firewall-rule create --resource-group testGroup --server-name testServer --name allowiprange --start-ip-address 107.46.14.0 --end-ip-address 107.46.14.221

Required Parameters

--end-ip-address

The end IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

--name -n

The name of the firewall rule. If name is omitted, default name will be chosen for firewall name. The firewall rule name can only contain 0-9, a-z, A-Z, '-' and '_'. Additionally, the firewall rule name cannot exceed 128 characters.

--resource-group -g

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

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--start-ip-address

The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

Optional Parameters

--subscription

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

az mysql flexible-server firewall-rule delete

Delete a firewall rule.

az mysql flexible-server firewall-rule delete [--ids]
                                              [--name]
                                              [--prompt]
                                              [--resource-group]
                                              [--server-name]
                                              [--subscription]

Examples

Delete a firewall rule.

az mysql flexible-server firewall-rule delete --name testRule --resource-group testGroup --server-name testServer

Optional Parameters

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

--name -n

The name of the firewall rule. If name is omitted, default name will be chosen for firewall name. The firewall rule name can only contain 0-9, a-z, A-Z, '-' and '_'. Additionally, the firewall rule name cannot exceed 128 characters.

--prompt

Turn confirmation prompt on/off. If off, the rule will be deleted without confirmation.

--resource-group -g

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

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--subscription

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

az mysql flexible-server firewall-rule list

List all firewall rules for a flexible server.

az mysql flexible-server firewall-rule list --resource-group
                                            --server-name
                                            [--query-examples]
                                            [--subscription]

Required Parameters

--resource-group -g

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

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

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

az mysql flexible-server firewall-rule show

Get the details of a firewall rule.

az mysql flexible-server firewall-rule show [--ids]
                                            [--name]
                                            [--query-examples]
                                            [--resource-group]
                                            [--server-name]
                                            [--subscription]

Examples

Get the details of a firewall rule.

az mysql flexible-server firewall-rule show --name testRule --resource-group testGroup --server-name testServer

Optional Parameters

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

--name -n

The name of the firewall rule. If name is omitted, default name will be chosen for firewall name. The firewall rule name can only contain 0-9, a-z, A-Z, '-' and '_'. Additionally, the firewall rule name cannot exceed 128 characters.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

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

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--subscription

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

az mysql flexible-server firewall-rule update

Update a firewall rule.

az mysql flexible-server firewall-rule update [--add]
                                              [--end-ip-address]
                                              [--force-string]
                                              [--ids]
                                              [--name]
                                              [--remove]
                                              [--resource-group]
                                              [--server-name]
                                              [--set]
                                              [--start-ip-address]
                                              [--subscription]

Examples

Update a firewall rule's start IP address.

az mysql flexible-server firewall-rule update --resource-group testGroup --server-name testServer --name allowiprange --start-ip-address 107.46.14.1

Update a firewall rule's start and end IP address.

az mysql flexible-server firewall-rule update --resource-group testGroup --server-name testServer --name allowiprange --start-ip-address 107.46.14.2 --end-ip-address 107.46.14.218

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

--end-ip-address

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

--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). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the firewall rule. If name is omitted, default name will be chosen for firewall name. The firewall rule name can only contain 0-9, a-z, A-Z, '-' and '_'. Additionally, the firewall rule name cannot exceed 128 characters.

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

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--set

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

--start-ip-address

The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

--subscription

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