Manage SQL servers.
CommandsCreate a server.
az sql server create --name
--resource-group
[--admin-password]
[--admin-user]
[--assign-identity]
[--enable-ad-only-auth]
[--enable-public-network {false, true}]
[--external-admin-name]
[--external-admin-principal-type]
[--external-admin-sid]
[--federated-client-id --fid]
[--identity-type {None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned}]
[--key-id]
[--location]
[--minimal-tls-version {1.0, 1.1, 1.2, 1.3}]
[--no-wait]
[--pid --primary-user-assigned-identity-id]
[--restrict-outbound-network-access {false, true}]
[--user-assigned-identity-id]
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
Create a server without SQL Admin, with AD admin and AD Only enabled.
az sql server create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName --external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer
Create a server without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is SystemAssigned,UserAssigned.
az sql server create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \ --external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer -i \ --user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \ --identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
Create a server without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is UserAssigned.
az sql server create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \ --external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer -i \ --user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \ --identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
Required Parameters
Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The administrator login password (required forserver creation).
Administrator username for the server. Oncecreated it cannot be changed.
Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.
Property Value Default value: FalseEnable Azure Active Directory Only Authentication for this server.
Property Value Default value: False--enable-public-network -e
Preview
Set whether public network access to server is allowed or not. When false,only connections made through Private Links can reach this server.
Property Value Accepted values: false, trueDisplay name of the Azure AD administrator user, group or application.
--external-admin-principal-type
User, Group or Application.
The unique ID of the Azure AD administrator. Object Id for User or Group, Client Id for Applications.
--federated-client-id --fid
The federated client id used in cross tenant CMK scenario.
Type of Identity to be used. Possible values are SystemAsssigned,UserAssigned, SystemAssigned,UserAssigned and None.
Property Value Accepted values: None, SystemAssigned, SystemAssigned,UserAssigned, UserAssignedThe key vault URI for encryption.
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
The minimal TLS version enforced by the sql server for inbound connections.
Property Value Accepted values: 1.0, 1.1, 1.2, 1.3Do not wait for the long-running operation to finish.
Property Value Default value: False--pid --primary-user-assigned-identity-id
The ID of the primary user managed identity.
--restrict-outbound-network-access -r
Preview
Set whether outbound network access to server is restricted or not. When true,the outbound connections from the server will be restricted.
Property Value Accepted values: false, true--user-assigned-identity-id -a
Generate and assign an User Managed Identity(UMI) for this server.
Global ParametersIncrease logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: FalseDeletes a server.
az sql server delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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 ArgumentsName of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Property Value Default value: False Global ParametersIncrease logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: FalseList available servers.
az sql server list [--expand-ad-admin]
[--resource-group]
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
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Expand the Active Directory Administrator for the server.
Property Value Default value: FalseName of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: False az sql server list-usagesGets server usages.
az sql server list-usages [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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 ArgumentsName of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: False az sql server refresh-external-governance-statusRefreshes external governance status.
az sql server refresh-external-governance-status [--ids]
[--resource-group]
[--server]
[--subscription]
Examples
Refresh external governance status for server
az sql server refresh-external-governance-status --resource-group MyResourceGroup --server MyServer
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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 ArgumentsName of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: FalseGets a server.
az sql server show [--expand-ad-admin]
[--ids]
[--name]
[--resource-group]
[--subscription]
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 the Active Directory Administrator for the server.
Property Value Default value: FalseOne 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 ArgumentsName of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: FalseUpdate a server.
az sql server update [--add]
[--admin-password]
[--assign_identity]
[--enable-public-network {false, true}]
[--federated-client-id --fid]
[--force-string]
[--identity-type {None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned}]
[--ids]
[--key-id]
[--minimal-tls-version {1.0, 1.1, 1.2, 1.3}]
[--name]
[--no-wait]
[--pid --primary-user-assigned-identity-id]
[--remove]
[--resource-group]
[--restrict-outbound-network-access {false, true}]
[--set]
[--subscription]
[--user-assigned-identity-id]
Examples
Update a server. (autogenerated)
az sql server update --admin-password myadminpassword --name MyAzureSQLServer --resource-group MyResourceGroup
Update a server with User Managed Identies and Identity Type is SystemAssigned,UserAssigned.
az sql server update -g myResourceGroup -n myServer -i \ --user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \ --identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
Update a server with User Managed Identies and Identity Type is UserAssigned.
az sql server update -g myResourceGroup -n myServer -i \ --user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \ --identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
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 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>
.
The administrator login password.
Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.
Property Value Default value: False--enable-public-network -e
Preview
Set whether public network access to server is allowed or not. When false,only connections made through Private Links can reach this server.
Property Value Accepted values: false, true--federated-client-id --fid
The federated client id used in cross tenant CMK scenario.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
Property Value Parameter group: Generic Update Arguments Default value: FalseType of Identity to be used. Possible values are SystemAsssigned,UserAssigned, SystemAssigned,UserAssigned and None.
Property Value Accepted values: None, SystemAssigned, SystemAssigned,UserAssigned, UserAssignedOne 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 ArgumentsThe key vault URI for encryption.
The minimal TLS version enforced by the sql server for inbound connections.
Property Value Accepted values: 1.0, 1.1, 1.2, 1.3Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Do not wait for the long-running operation to finish.
Property Value Default value: False--pid --primary-user-assigned-identity-id
The ID of the primary user managed identity.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
--restrict-outbound-network-access -r
Preview
Set whether outbound network access to server is restricted or not. When true,the outbound connections from the server will be restricted.
Property Value Accepted values: false, trueUpdate an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
--user-assigned-identity-id -a
Generate and assign an User Managed Identity(UMI) for this server.
Global ParametersIncrease logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: FalsePlace the CLI in a waiting state until a condition of the SQL server is met.
az sql server wait [--created]
[--custom]
[--deleted]
[--exists]
[--expand]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Wait until created with 'provisioningState' at 'Succeeded'.
Property Value Parameter group: Wait Condition Arguments Default value: FalseWait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Property Value Parameter group: Wait Condition ArgumentsWait until deleted.
Property Value Parameter group: Wait Condition Arguments Default value: FalseWait until the resource exists.
Property Value Parameter group: Wait Condition Arguments Default value: FalseThe child resources to include in the response. Default value is None.
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 ArgumentsPolling interval in seconds.
Property Value Parameter group: Wait Condition Arguments Default value: 30Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Property Value Parameter group: Wait Condition Arguments Default value: 3600Wait until updated with provisioningState at 'Succeeded'.
Property Value Parameter group: Wait Condition Arguments Default value: False Global ParametersIncrease logging verbosity to show all debug logs.
Property Value Default value: FalseShow this help message and exit.
Only show errors, suppressing warnings.
Property Value Default value: FalseOutput format.
Property Value Default value: json Accepted values: json, jsonc, none, table, tsv, yaml, yamlcJMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property Value Default value: FalseRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4