az sql server

Manage SQL servers.

Commands

az sql server ad-admin

Manage a server's Active Directory administrator.

az sql server ad-admin create

Create a new server Active Directory administrator.

az sql server ad-admin delete

Deletes the Azure Active Directory administrator with the given name.

az sql server ad-admin list

Gets a list of Azure Active Directory administrators in a server.

az sql server ad-admin update

Update an existing server Active Directory administrator.

az sql server ad-only-auth

Manage Azure Active Directly only Authentication settings for this Server.

az sql server ad-only-auth disable

Disable Azure Active Directly only Authentication for this Server.

az sql server ad-only-auth enable

Enable Azure Active Directly only Authentication for this Server.

az sql server ad-only-auth get

Get a specific Azure Active Directly only Authentication property.

az sql server audit-policy

Manage a server's auditing policy.

az sql server audit-policy show

Show server audit policy.

az sql server audit-policy update

Update a server's auditing policy.

az sql server audit-policy wait

Place the CLI in a waiting state until a condition of the server's audit policy is met.

az sql server conn-policy

Manage a server's connection policy.

az sql server conn-policy show

Gets a server's secure connection policy.

az sql server conn-policy update

Updates a server's secure connection policy.

az sql server create

Create a server.

az sql server delete

Deletes a server.

az sql server dns-alias

Manage a server's DNS aliases.

az sql server dns-alias create

Creates a server dns alias.

az sql server dns-alias delete

Deletes the server DNS alias with the given name.

az sql server dns-alias list

Gets a list of server DNS aliases for a server.

az sql server dns-alias set

Sets a server to which DNS alias should point.

az sql server dns-alias show

Gets a server DNS alias.

az sql server firewall-rule

Manage a server's firewall rules.

az sql server firewall-rule create

Create a firewall rule.

az sql server firewall-rule delete

Deletes a firewall rule.

az sql server firewall-rule list

List a server's firewall rules.

az sql server firewall-rule show

Shows the details for a firewall rule.

az sql server firewall-rule update

Update a firewall rule.

az sql server key

Manage a server's keys.

az sql server key create

Creates a server key.

az sql server key delete

Deletes a server key.

az sql server key list

Gets a list of server keys.

az sql server key show

Shows a server key.

az sql server list

List available servers.

az sql server list-usages

Returns server usages.

az sql server show

Gets a server.

az sql server tde-key

Manage a server's encryption protector.

az sql server tde-key set

Sets the server's encryption protector.

az sql server tde-key show

Gets a server encryption protector.

az sql server update

Update a server.

az sql server vnet-rule

Manage a server's virtual network rules.

az sql server vnet-rule create

Create a virtual network rule to allows access to an Azure SQL server.

az sql server vnet-rule delete

Deletes the virtual network rule with the given name.

az sql server vnet-rule list

Gets a list of virtual network rules in a server.

az sql server vnet-rule show

Gets a virtual network rule.

az sql server vnet-rule update

Update a virtual network rule.

az sql server wait

Place the CLI in a waiting state until a condition of the SQL server is met.

az sql server create

Create a server.

az sql server create --admin-password
                     --admin-user
                     --name
                     --resource-group
                     [--assign-identity]
                     [--enable-public-network {false, true}]
                     [--location]
                     [--minimal-tls-version {1.0, 1.1, 1.2}]
                     [--no-wait]
                     [--subscription]

Examples

Create a server.

az sql server create -l westus -g mygroup -n myserver -u myadminuser -p myadminpassword

Create a server with disabled public network access to server.

az sql server create -l westus -g mygroup -n myserver -u myadminuser -p myadminpassword -e false

Required Parameters

--admin-password -p

The administrator login password (required for server creation).

--admin-user -u

Administrator username for the server. Once created it cannot be changed.

--name -n

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--resource-group -g

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

Optional Parameters

--assign-identity -i

Generate and assign an Azure Active Directory Identity for this serverfor use with key management services like Azure KeyVault.

--enable-public-network -e

Set whether public network access to server is allowed or not. When false,only connections made through Private Links can reach this server.

accepted values: false, true
--location -l

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

--minimal-tls-version

The minimal TLS version enforced by the sql server for inbound connections.

accepted values: 1.0, 1.1, 1.2
--no-wait

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

--subscription

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

az sql server delete

Deletes a server.

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

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

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--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 server list

List available servers.

az sql server list [--query-examples]
                   [--resource-group]
                   [--subscription]

Examples

List all servers in the current subscription.

az sql server list

List all servers in a resource group.

az sql server list -g mygroup

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.

--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 server list-usages

Returns server usages.

az sql server list-usages [--ids]
                          [--name]
                          [--resource-group]
                          [--subscription]

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

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

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

Gets a server.

az sql server show [--ids]
                   [--name]
                   [--query-examples]
                   [--resource-group]
                   [--subscription]

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

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

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

--subscription

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

az sql server update

Update a server.

az sql server update [--add]
                     [--admin-password]
                     [--assign_identity]
                     [--enable-public-network {false, true}]
                     [--force-string]
                     [--ids]
                     [--minimal-tls-version {1.0, 1.1, 1.2}]
                     [--name]
                     [--no-wait]
                     [--remove]
                     [--resource-group]
                     [--set]
                     [--subscription]

Examples

Update a server. (autogenerated)

az sql server update --admin-password myadminpassword --name MyAzureSQLServer --resource-group MyResourceGroup

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 administrator login password.

--assign_identity -i

Generate and assign an Azure Active Directory Identity for this serverfor use with key management services like Azure KeyVault.

--enable-public-network -e

Set whether public network access to server is allowed or not. When false,only connections made through Private Links can reach this server.

accepted values: false, true
--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.

--minimal-tls-version

The minimal TLS version enforced by the sql server for inbound connections.

accepted values: 1.0, 1.1, 1.2
--name -n

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--no-wait

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

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

--subscription

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

az sql server wait

Place the CLI in a waiting state until a condition of the SQL server is met.

az sql server wait [--created]
                   [--custom]
                   [--deleted]
                   [--exists]
                   [--ids]
                   [--interval]
                   [--name]
                   [--resource-group]
                   [--subscription]
                   [--timeout]
                   [--updated]

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

--custom

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

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

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

--interval

Polling interval in seconds.

default value: 30
--name -n

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

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

Wait until updated with provisioningState at 'Succeeded'.