快速入门:使用 ARM 模板创建 Azure Synapse Analytics SQL 池Quickstart: Create an Azure Synapse Analytics SQL pool by using an ARM template

使用此 Azure 资源管理器模板(ARM 模板)创建 Azure Synapse Analytics SQL 池,并启用透明数据加密。This Azure Resource Manager template (ARM template) will create an Azure Synapse Analytics SQL pool with Transparent Data Encryption enabled. Synapse SQL 池是指 Azure Synapse 中正式发布的企业数据仓库功能。Synapse SQL pool refers to the enterprise data warehousing features that are generally available in Azure Synapse.

ARM 模板是定义项目基础结构和配置的 JavaScript 对象表示法 (JSON) 文件。An ARM template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. 该模板使用声明性语法,使你可以声明要部署的内容,而不需要编写一系列编程命令来进行创建。The template uses declarative syntax, which lets you state what you intend to deploy without having to write the sequence of programming commands to create it.

如果你的环境满足先决条件,并且你熟悉如何使用 ARM 模板,请选择“部署到 Azure”按钮。If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. Azure 门户中会打开模板。The template will open in the Azure portal.

部署到 AzureDeploy to Azure

先决条件Prerequisites

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

查看模板Review the template

本快速入门中使用的模板来自 Azure 快速启动模板The template used in this quickstart is from Azure Quickstart Templates.

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "sqlServerName": {
      "defaultValue": "[concat('sql', uniqueString(resourceGroup().id))]",
      "type": "string",
      "metadata": {
        "description": "The SQL Logical Server name."
      }
    },
    "sqlAdministratorLogin": {
      "type": "string",
      "metadata": {
        "description": "The administrator username of the SQL Server."
      }
    },
    "sqlAdministratorPassword": {
      "type": "securestring",
      "metadata": {
        "description": "The administrator password of the SQL Server."
      }
    },
    "dataWarehouseName": {
      "type": "string",
      "metadata": {
        "description": "The name of the Data Warehouse."
      }
    },
    "transparentDataEncryption": {
      "defaultValue": "Enabled",
      "type": "string",
      "allowedValues": [
        "Enabled",
        "Disabled"
      ],
      "metadata": {
        "description": "Enable/Disable Transparent Data Encryption"
      }
    },
    "serviceLevelObjective": {
      "defaultValue": "DW400c",
      "type": "string",
      "metadata": {
        "description": "Performance Level"
      }
    },
    "location": {
      "defaultValue": "[resourceGroup().location]",
      "type": "string",
      "metadata": {
        "description": "Resource location"
      }
    }
  },
  "variables": {},
  "resources": [
    {
      "name": "[parameters('sqlServerName')]",
      "type": "Microsoft.Sql/servers",
      "apiVersion": "2015-05-01-preview",
      "location": "[parameters('location')]",
      "properties": {
        "administratorLogin": "[parameters('sqlAdministratorLogin')]",
        "administratorLoginPassword": "[parameters('sqlAdministratorPassword')]",
        "version": "12.0"
      },
      "resources": [
        {
          "type": "databases",
          "kind": "v12.0,user,datawarehouse",
          "name": "[parameters('dataWarehouseName')]",
          "apiVersion": "2015-05-01-preview",
          "location": "[parameters('location')]",
          "properties": {
            "edition": "DataWarehouse",
            "status": "Online",
            "requestedServiceObjectiveName": "[parameters('serviceLevelObjective')]",
            "collation": "SQL_Latin1_General_CP1_CI_AS",
            "readScale": "Disabled",
            "zoneRedundant": false,
            "isUpgradeRequested": false
          },
          "dependsOn": [
            "[parameters('sqlServerName')]"
          ],
          "resources": [
            {
              "comments": "Transparent Data Encryption",
              "name": "current",
              "type": "transparentDataEncryption",
              "apiVersion": "2017-03-01-preview",
              "properties": {
                "status": "[parameters('transparentDataEncryption')]"
              },
              "dependsOn": [
                "[parameters('dataWarehouseName')]"
              ]
            }
          ]
        }
      ]
    }
  ]
}

该模板定义一个资源:The template defines one resource:

部署模板Deploy the template

  1. 选择下图登录到 Azure 并打开模板。Select the following image to sign in to Azure and open the template. 使用此模板创建 Synapse SQL 池。This template creates a Synapse SQL pool.

    部署到 AzureDeploy to Azure

  2. 输入或更新以下值:Enter or update the following values:

    • 订阅:选择 Azure 订阅。Subscription: Select an Azure subscription.
    • 资源组: 选择“新建”,输入资源组的唯一名称,然后选择“确定”。Resource group: Select Create new and enter a unique name for the resource group and select OK. 新的资源组会促进资源清理。A new resource group will facilitate resource clean up.
    • 区域:选择区域。Region: Select a region. 例如,“中国东部 2”。For example, China East 2.
    • SQL Server 名称:接受默认名称,或为 SQL Server 名称输入新名称。SQL Server name: Accept the default name or enter a name for the SQL Server name.
    • SQL 管理员登录:输入 SQL Server 的管理员用户名。SQL Administrator login: Enter the administrator username for the SQL Server.
    • SQL 管理员密码:输入 SQL Server 的管理员密码。SQL Administrator password: Enter the administrator password for the SQL Server.
    • 数据仓库名称:输入 SQL 池名称。Data Warehouse Name: Enter a SQL pool name.
    • 透明数据加密:接受默认值“已启用”。Transparent Data Encryption: Accept the default, enabled.
    • 服务级别目标:接受默认值“DW400c”。Service Level Objective: Accept the default, DW400c.
    • 位置:接受资源组的默认位置。Location: Accept the default location of the resource group.
    • 审阅并创建:选中。Review and Create: Select.
    • 创建:选中。Create: Select.

查看已部署的资源Review deployed resources

可以使用 Azure 门户来检查已部署的资源,也可以使用 Azure CLI 或 Azure PowerShell 脚本列出已部署的资源。You can either use the Azure portal to check the deployed resources, or use Azure CLI or Azure PowerShell script to list the deployed resources.

echo "Enter the resource group where your Synapse SQL pool exists:" &&
read resourcegroupName &&
az resource list --resource-group $resourcegroupName 

清理资源Clean up resources

不再需要时,可使用 Azure CLI 或 Azure PowerShell 删除资源组:When no longer needed, delete the resource group by using Azure CLI or Azure PowerShell:

echo "Enter the Resource Group name:" &&
read resourceGroupName &&
az group delete --name $resourceGroupName &&
echo "Press [ENTER] to continue ..."

后续步骤Next steps

在本快速入门中,你使用 ARM 模板创建了 Azure Synapse Analytics SQL 池,并验证了部署。In this quickstart, you created an Azure Synapse Analytics SQL pool using an ARM template and validated the deployment. 若要详细了解 Azure Synapse Analytics 和 Azure 资源管理器,请继续阅读以下文章。To learn more about Azure Synapse Analytics and Azure Resource Manager, continue on to the articles below.