az mariadb server

Manage MariaDB servers.

Commands

az mariadb server configuration Manage configuration values for a server.
az mariadb server configuration list List the configuration values for a server.
az mariadb server configuration set Update the configuration of a server.
az mariadb server configuration show Get the configuration for a server.".
az mariadb server create Create a server.
az mariadb server delete Delete a server.
az mariadb server firewall-rule Manage firewall rules for a server.
az mariadb server firewall-rule create Create a new firewall rule for a server.
az mariadb server firewall-rule delete Delete a firewall rule.
az mariadb server firewall-rule list List all firewall rules for a server.
az mariadb server firewall-rule show Get the details of a firewall rule.
az mariadb server firewall-rule update Update a firewall rule.
az mariadb server georestore Geo-restore a server from backup.
az mariadb server list List available servers.
az mariadb server replica Manage read replicas.
az mariadb server replica create Create a read replica for a server.
az mariadb server replica list List all read replicas for a given server.
az mariadb server replica stop Stop replication to a read replica and make it a read/write server.
az mariadb server restart Restart a server.
az mariadb server restore Restore a server from backup.
az mariadb server show Get the details of a server.
az mariadb server update Update a server.
az mariadb server vnet-rule Manage a server's virtual network rules.
az mariadb server vnet-rule create Create a virtual network rule to allows access to a MariaDB server.
az mariadb server vnet-rule delete Deletes the virtual network rule with the given name.
az mariadb server vnet-rule list Gets a list of virtual network rules in a server.
az mariadb server vnet-rule show Gets a virtual network rule.
az mariadb server vnet-rule update Update a virtual network rule.
az mariadb server wait Wait for server to satisfy certain conditions.

az mariadb server create

Create a server.

az mariadb server create --admin-password
--admin-user
--name
--resource-group
--sku-name
[--auto-grow {Disabled, Enabled}]
[--backup-retention]
[--geo-redundant-backup {Disabled, Enabled}]
[--location]
[--ssl-enforcement {Disabled, Enabled}]
[--storage-size]
[--subscription]
[--tags]
[--version]

Examples

Create a MariaDB server in North Europe with sku GP_Gen5_2 (General Purpose, Gen 5 hardware, 2 vCores).

az mariadb server create -l northeurope -g testgroup -n testsvr -u username -p password \ --sku-name GP_Gen5_2

Create a MariaDB server with all paramaters set.

az mariadb server create -l northeurope -g testgroup -n testsvr -u username -p password \ --sku-name B_Gen5_1 --ssl-enforcement Disabled \ --backup-retention 10 --geo-redundant-backup Enabled --storage-size 51200 --tags "key=value" --version {server-version}

Required Parameters

--admin-password -p

The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.

--admin-user -u

Administrator username for the server. Once set, it cannot be changed.

--name -n

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

--resource-group -g

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

--sku-name

The name of the sku. Follows the convention {pricing tier}{compute generation}{vCores} in shorthand. Examples: B_Gen5_1, GP_Gen5_4, MO_Gen5_16.

Optional Parameters

--auto-grow

Enable or disable autogrow of the storage. Default value is Enabled.

accepted values: Disabled, Enabled
default value: Enabled
--backup-retention

The number of days a backup is retained. Range of 7 to 35 days. Default is 7 days.

--geo-redundant-backup

Enable or disable geo-redundant backups. Default value is Disabled. Not supported in Basic pricing tier.

accepted values: Disabled, Enabled
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--ssl-enforcement

Enable or disable ssl enforcement for connections to server. Default is Enabled.

accepted values: Disabled, Enabled
--storage-size

The storage capacity of the server (unit is megabytes). Minimum 5120 and increases in 1024 increments. Default is 51200.

--subscription

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

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

--version

Server major version.

az mariadb server delete

Delete a server.

az mariadb server delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]

Examples

Delete a server.

az mariadb server delete -g testgroup -n testsvr

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 server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--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 mariadb server georestore

Geo-restore a server from backup.

az mariadb server georestore --location
--source-server
[--backup-retention]
[--geo-redundant-backup]
[--ids]
[--name]
[--no-wait]
[--resource-group]
[--sku-name]
[--subscription]

Examples

Geo-restore 'testsvr' into a new server 'testsvrnew' located in West US 2.

az mariadb server georestore -g testgroup -n testsvrnew --source-server testsvr -l westus2

Geo-restore 'testsvr' into a new server 'testsvrnew' located in West US 2 with sku GP_Gen5_2.

az mariadb server georestore -g testgroup -n testsvrnew --source-server testsvr -l westus2 --sku-name GP_Gen5_2

Geo-restore 'testsvr2' into a new server 'testsvrnew', where 'testsvrnew' is in a different resource group from 'testsvr2'.

az mariadb server georestore -g testgroup -n testsvrnew \
    -s "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMariaDB/servers/testsvr2" \
    -l westus2

Required Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--source-server -s

The name or ID of the source server to restore from.

Optional Parameters

--backup-retention

The number of days a backup is retained. Range of 7 to 35 days. Default is 7 days.

--geo-redundant-backup

Enable or disable geo-redundant backups. Default value is Disabled. Not supported in Basic pricing tier.

--ids

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

--name -n

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

--no-wait

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

--resource-group -g

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

--sku-name

The name of the sku. Defaults to sku of the source server. Follows the convention {pricing tier}{compute generation}{vCores} in shorthand. Examples: B_Gen5_1, GP_Gen5_4, MO_Gen5_16.

--subscription

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

az mariadb server list

List available servers.

az mariadb server list [--resource-group]
[--subscription]

Examples

List all MariaDB servers in a subscription.

az mariadb server list

List all MariaDB servers in a resource group.

az mariadb server list -g testgroup

Optional Parameters

--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 mariadb server restart

Restart a server.

az mariadb server restart [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Restart a server.

az mariadb server restart -g testgroup -n testsvr

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 server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--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 mariadb server restore

Restore a server from backup.

az mariadb server restore --restore-point-in-time
--source-server
[--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]

Examples

Restore 'testsvr' to a specific point-in-time as a new server 'testsvrnew'.

az mariadb server restore -g testgroup -n testsvrnew --source-server testsvr --restore-point-in-time "2017-06-15T13:10:00Z"

Restore 'testsvr2' to 'testsvrnew', where 'testsvrnew' is in a different resource group from 'testsvr2'.

az mariadb server restore -g testgroup -n testsvrnew \
    -s "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMariaDB/servers/testsvr2" \
    --restore-point-in-time "2017-06-15T13:10:00Z"

Required Parameters

--restore-point-in-time

The point in time to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+08:00.

--source-server -s

The name or resource ID of the source server to restore from.

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 server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--no-wait

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

--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 mariadb server show

Get the details of a server.

az mariadb server show [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Get the details of a server. (autogenerated)

az mariadb server show --name MyServer --resource-group MyResourceGroup

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 server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--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 mariadb server update

Update a server.

az mariadb server update [--add]
[--admin-password]
[--auto-grow {Disabled, Enabled}]
[--backup-retention]
[--force-string]
[--ids]
[--name]
[--remove]
[--resource-group]
[--set]
[--sku-name]
[--ssl-enforcement {Disabled, Enabled}]
[--storage-size]
[--subscription]
[--tags]

Examples

Update a server's sku.

az mariadb server update -g testgroup -n testsvrnew --sku-name GP_Gen5_4

Update a server's tags.

az mariadb server update -g testgroup -n testsvrnew --tags "k1=v1" "k2=v2"

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

--admin-password -p

The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.

--auto-grow

Enable or disable autogrow of the storage. Default value is Enabled.

accepted values: Disabled, Enabled
--backup-retention

The number of days a backup is retained. Range of 7 to 35 days. Default is 7 days.

--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 server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 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>.

--set

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

--sku-name

The name of the sku. Follows the convention {pricing tier}{compute generation}{vCores} in shorthand. Examples: B_Gen5_1, GP_Gen5_4, MO_Gen5_16.

--ssl-enforcement

Enable or disable ssl enforcement for connections to server. Default is Enabled.

accepted values: Disabled, Enabled
--storage-size

The storage capacity of the server (unit is megabytes). Minimum 5120 and increases in 1024 increments. Default is 51200.

--subscription

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

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

az mariadb server wait

Wait for server to satisfy certain conditions.

az mariadb server wait [--custom]
[--exists]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]

Optional Parameters

--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--exists

Wait until the resource exists.

--ids

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

--interval

Polling interval in seconds.

default value: 30
--name -n

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

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

--timeout

Maximum wait in seconds.

default value: 3600