Azure CLI reference commands for Azure SQL
The Azure Command-Line Interface (CLI) is a set of commands used to create and manage Azure resources. It's available across many Azure services and gives you the ability to manage Azure SQL services from a command-line.
The Azure CLI commands for Azure SQL is composed of core references only and ships as part of the Azure CLI. See az sql for an alphabetic list of the Azure CLI core and extension references available for the Azure SQL service. For references for each subgroup, see the tables in the following sections:
- SQL database
- SQL Managed Instance
- SQL Managed Instance database
- SQL server
- SQL virtual machine
- Additional references
SQL database references
| Reference | Description | More information |
|---|---|---|
| az sql db | Manage Azure SQL Database. | What is Azure SQL Database? |
| az sql db audit-policy | Manage a SQL database's auditing policy. | Auditing for Azure SQL Database |
| az sql db classification | Manage a SQL database's sensitivity classifications. | Data discovery and classification |
| az sql db classification recommendation | Manage a database's sensitivity classification recommendations. | Data discovery and classification |
| az sql db ltr-backup | Manage a SQL database's long-term retention backup. | Long-term retention |
| az sql db ltr-policy | Manage a SQL database's long-term retention policy. | Manage Azure SQL Database long-term backup retention |
| az sql db op | Manage the operations on a SQL database. | Configure and manage content reference |
| az sql db replica | Manage replication between SQL databases. | Replication to Azure SQL Database |
| az sql db tde | Manage a SQL database's transparent data encryption. | Transparent data encryption |
| az sql db threat-policy | Manage a SQL database's threat detection policies. | Configure Advanced Threat Protection |
SQL Managed Instance references
| Reference | Description | More information |
|---|---|---|
| az sql mi | Manage Azure SQL Managed Instance. | What is Azure SQL Managed Instance? |
| az sql mi ad-admin | Manage a SQL Managed Instance's Active Directory administrator. | Configure and manage Azure AD authentication with Azure SQL |
| az sql mi ad-only-auth | Manage a SQL Managed Instance Azure Active Directory-only settings. | Configure and manage Azure AD authentication with Azure SQL |
| az sql mi key | Manage a SQL Managed Instance's keys. | Configure Always Encrypted by using Azure Key Vault |
| az sql mi op | Manage operations on a SQL Managed Instance. | Overview of Azure SQL Managed Instance management operations |
| az sql mi tde-key | Manage a SQL Managed Instance's encryption protector. | Transparent data encryption |
SQL Managed Instance database references
| Reference | Description | More information |
|---|---|---|
| az sql midb | Manage Azure SQL Managed Instance databases. | What is Azure SQL Managed Instance? |
| az sql midb log-replay | Manage Log Replay service commands for an Azure SQL Managed Instance database. | Migrate databases from SQL Server to SQL Managed Instance by using Log Replay Service |
| az sql midb ltr-backup | Manage SQL Managed Instance database long-term retention backups. | Manage Azure SQL Managed Instance long-term backup retention |
| az sql midb ltr-policy | Manage SQL Managed Instance database long-term retention policy. | Long-term retention |
| az sql midb short-term-retention-policy | Manage SQL Managed Instance database backup short-term retention policy. | Automated backups |
SQL server references
SQL virtual machine references
| Reference | Description | More information |
|---|---|---|
| az sql vm | Manage SQL virtual machines. | What is SQL Server on Azure Virtual Machines |
| az sql vm group | Manage SQL virtual machine groups. | Always On availability group on SQL Server on Azure VMs |
| az sql vm group ag-listener | Manage SQL availability group listeners. | Configure one or more Always On availability group listeners |
Additional SQL references
| Reference | Description | More information |
|---|---|---|
| az sql | Manage Azure SQL. | What is Azure SQL? |
| az sql dw | Manage data warehouses. | What is dedicated SQL pool (formerly SQL DW) in Azure Synapse Analytics? |
| az sql elastic-pool | Manage elastic pools. | Elastic pools |
| az sql elastic-pool op | Manage operations on an elastic pool. | Elastic pools |
| az sql failover-group | Manage SQL Database failover groups. | Configure a failover group |
| az sql instance-failover-group | Use SQL Managed Instance failover groups. | Configure a failover group |
| az sql instance-pool | Use Manage Instance pools. | What is an Azure SQL Managed Instance pool? |
| az sql stg | Manage Server Trust Groups. | Use Server Trust Groups |
| az sql virtual-cluster | Manage the virtual cluster of a SQL Managed Instance. | Virtual cluster connectivity architecture |
See also
- Get started with Azure CLI to learn about installation and sign in.
- Discover additional reference commands and available extensions in the Azure CLI documentation.
- Learn to use Bash with the Azure CLI
Feedback
Submit and view feedback for

