适用于 Azure SQL 数据库的 Azure CLI 示例Azure CLI samples for Azure SQL Database

可以使用 Azure CLI 配置 Azure SQL 数据库。Azure SQL Database can be configured using Azure CLI.

如果没有 Azure 订阅,可在开始前创建一个试用帐户If you don't have an Azure subscription, create a trial account before you begin.

可以在本地安装并使用 CLI,本主题要求运行 Azure CLI 2.0 或更高版本。You can install and use the CLI locally, this topic requires that you are running the Azure CLI version 2.0 or later. 运行 az --version 即可查找版本。Run az --version to find the version. 如需进行安装或升级,请参阅安装 Azure CLIIf you need to install or upgrade, see Install the Azure CLI.

单一数据库和弹性池Single database & Elastic pools

下表包括适用于 Azure SQL 数据库的 Azure CLI 脚本示例的链接。The following table includes links to Azure CLI script examples for Azure SQL Database.

创建单一数据库和弹性池Create a single database and an elastic pool
创建单一数据库和配置防火墙规则Create a single database and configure a firewall rule 此 CLI 脚本示例创建单个 Azure SQL 数据库并配置服务器级防火墙规则。This CLI script example creates a single Azure SQL database and configures a server-level firewall rule.
创建弹性池并移动入池数据库Create elastic pools and move pooled databases 此 CLI 脚本示例创建 SQL 弹性池,移动入池 Azure SQL 数据库,并更改计算大小。This CLI script example creates SQL elastic pools, and moves pooled Azure SQL databases, and changes compute sizes.
缩放单一数据库和弹性池Scale a single database and an elastic pool
缩放单一数据库Scale a single database 此 CLI 脚本示例在查询数据库的大小信息后,将单个 Azure SQL 数据库缩放为不同的计算大小。This CLI script example scales a single Azure SQL database to a different compute size after querying the size information for the database.
缩放弹性池Scale an elastic pool 此 CLI 脚本示例将 SQL 弹性池缩放为不同的计算大小。This CLI script example scales a SQL elastic pool to a different compute size.

详细了解单一数据库 Azure CLI APILearn more about the Single Database Azure CLI API.