Bicep 資源定義
工作區/sqlPools 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
使用範例
Bicep 範例
部署 Synapse SQL 集區的基本範例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
@description('The SQL administrator login name for the Synapse workspace')
param sqlAdministratorLogin string
@secure()
@description('The SQL administrator login password for the Synapse workspace')
param sqlAdministratorLoginPassword string
resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' existing = {
name: 'default'
parent: storageAccount
}
resource workspace 'Microsoft.Synapse/workspaces@2021-06-01' = {
name: resourceName
location: location
properties: {
defaultDataLakeStorage: {
accountUrl: storageAccount.properties.primaryEndpoints.dfs
filesystem: container.name
}
managedVirtualNetwork: ''
publicNetworkAccess: 'Enabled'
sqlAdministratorLogin: sqlAdministratorLogin
sqlAdministratorLoginPassword: sqlAdministratorLoginPassword
}
}
resource sqlPool 'Microsoft.Synapse/workspaces/sqlPools@2021-06-01' = {
name: resourceName
location: location
parent: workspace
sku: {
name: 'DW100c'
}
properties: {
createMode: 'Default'
}
}
resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01' = {
name: resourceName
parent: blobService
properties: {
metadata: {
key: 'value'
}
}
}
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' = {
name: resourceName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {}
}
資源格式
若要建立 Microsoft.Synapse/workspaces/sqlPools 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Synapse/workspaces/sqlPools@2021-03-01' = {
parent: resourceSymbolicName
location: 'string'
name: 'string'
properties: {
collation: 'string'
createMode: 'string'
creationDate: 'string'
maxSizeBytes: int
provisioningState: 'string'
recoverableDatabaseId: 'string'
restorePointInTime: 'string'
sourceDatabaseId: 'string'
status: 'string'
storageAccountType: 'string'
}
sku: {
capacity: int
name: 'string'
tier: 'string'
}
tags: {
{customized property}: 'string'
}
}
屬性值
Microsoft.Synapse/workspaces/sqlPools
| 名字 | 描述 | 價值 |
|---|---|---|
| 位置 | 資源所在的地理位置 | 字串 (必要) |
| 名字 | 資源名稱 | 字串 (必要) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型的資源符號名稱:工作區 |
| 性能 | SQL 集區屬性 | SqlPoolResourceProperties |
| SKU | SQL 集區 SKU | Sku |
| 標籤 | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
Sku
| 名字 | 描述 | 價值 |
|---|---|---|
| 容量 | 如果 SKU 支援相應放大/縮小,則應該包含容量整數。 如果資源無法相應放大/縮小,可能會省略此專案。 | 整數 (int) |
| 名字 | SKU 名稱 | 字串 |
| 分層 | 服務層級 | 字串 |
SqlPoolResourceProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 定序 | 定序模式 | 字串 |
| createMode | 指定 sql 集區建立模式。 預設值:建立一般 SQL 集區。 PointInTimeRestore:藉由還原現有 sql 集區的時間點備份來建立 sql 集區。 sourceDatabaseId 必須指定為現有 sql 集區的資源識別碼,而且必須指定 restorePointInTime。 復原:藉由異地復寫備份建立 sql 集區。 sourceDatabaseId 必須指定為要還原的 recoverableDatabaseId。 還原:藉由還原已刪除 SQL 集區的備份來建立 sql 集區。 SourceDatabaseId 應該是 sql 集區的原始資源標識碼。 必須指定SourceDatabaseId和sourceDatabaseDeletionDate。 |
預設 'PointInTimeRestore' 'Recovery' 'Restore' |
| 創建日期 | 建立 SQL 集區的日期 | 字串 |
| maxSizeBytes | 位元組大小上限 | 整數 (int) |
| 佈建狀態 | 資源狀態 | 字串 |
| recoverableDatabaseId | 備份要從中還原的資料庫 | 字串 |
| restorePointInTime | 要還原的快照集時間 | 字串 |
| sourceDatabaseId | 要從中建立的源資料庫 | 字串 |
| 狀態 | 資源狀態 | 字串 |
| storageAccountType | 用來儲存此 sql 集區的備份的記憶體帳戶類型。 | 'GRS' 'LRS' 'ZRS' |
TrackedResourceTags
| 名字 | 描述 | 價值 |
|---|
ARM 樣本資源定義
工作區/sqlPools 資源類型可以使用目標作業來部署:
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
| 範本 | 描述 |
|---|---|
|
Azure Synapse 概念證明 |
此範本會建立 Azure Synapse 的概念證明環境,包括 SQL 集區和選擇性的 Apache Spark 集區 |
資源格式
若要建立 Microsoft.Synapse/workspaces/sqlPools 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Synapse/workspaces/sqlPools",
"apiVersion": "2021-03-01",
"name": "string",
"location": "string",
"properties": {
"collation": "string",
"createMode": "string",
"creationDate": "string",
"maxSizeBytes": "int",
"provisioningState": "string",
"recoverableDatabaseId": "string",
"restorePointInTime": "string",
"sourceDatabaseId": "string",
"status": "string",
"storageAccountType": "string"
},
"sku": {
"capacity": "int",
"name": "string",
"tier": "string"
},
"tags": {
"{customized property}": "string"
}
}
屬性值
Microsoft.Synapse/workspaces/sqlPools
| 名字 | 描述 | 價值 |
|---|---|---|
| apiVersion | API 版本 | '2021-03-01' |
| 位置 | 資源所在的地理位置 | 字串 (必要) |
| 名字 | 資源名稱 | 字串 (必要) |
| 性能 | SQL 集區屬性 | SqlPoolResourceProperties |
| SKU | SQL 集區 SKU | Sku |
| 標籤 | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 | 資源類型 | 'Microsoft.Synapse/workspaces/sqlPools' |
Sku
| 名字 | 描述 | 價值 |
|---|---|---|
| 容量 | 如果 SKU 支援相應放大/縮小,則應該包含容量整數。 如果資源無法相應放大/縮小,可能會省略此專案。 | 整數 (int) |
| 名字 | SKU 名稱 | 字串 |
| 分層 | 服務層級 | 字串 |
SqlPoolResourceProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 定序 | 定序模式 | 字串 |
| createMode | 指定 sql 集區建立模式。 預設值:建立一般 SQL 集區。 PointInTimeRestore:藉由還原現有 sql 集區的時間點備份來建立 sql 集區。 sourceDatabaseId 必須指定為現有 sql 集區的資源識別碼,而且必須指定 restorePointInTime。 復原:藉由異地復寫備份建立 sql 集區。 sourceDatabaseId 必須指定為要還原的 recoverableDatabaseId。 還原:藉由還原已刪除 SQL 集區的備份來建立 sql 集區。 SourceDatabaseId 應該是 sql 集區的原始資源標識碼。 必須指定SourceDatabaseId和sourceDatabaseDeletionDate。 |
預設 'PointInTimeRestore' 'Recovery' 'Restore' |
| 創建日期 | 建立 SQL 集區的日期 | 字串 |
| maxSizeBytes | 位元組大小上限 | 整數 (int) |
| 佈建狀態 | 資源狀態 | 字串 |
| recoverableDatabaseId | 備份要從中還原的資料庫 | 字串 |
| restorePointInTime | 要還原的快照集時間 | 字串 |
| sourceDatabaseId | 要從中建立的源資料庫 | 字串 |
| 狀態 | 資源狀態 | 字串 |
| storageAccountType | 用來儲存此 sql 集區的備份的記憶體帳戶類型。 | 'GRS' 'LRS' 'ZRS' |
TrackedResourceTags
| 名字 | 描述 | 價值 |
|---|
Terraform (AzAPI 提供者) 資源定義
工作區/sqlPools 資源類型可以使用目標作業來部署:
- 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
Terraform 範例
部署 Synapse SQL 集區的基本範例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
variable "sql_administrator_login" {
type = string
description = "The SQL administrator login name for the Synapse workspace"
}
variable "sql_administrator_login_password" {
type = string
description = "The SQL administrator login password for the Synapse workspace"
sensitive = true
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "storageAccount" {
type = "Microsoft.Storage/storageAccounts@2021-09-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
kind = "StorageV2"
properties = {
}
sku = {
name = "Standard_LRS"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
data "azapi_resource_action" "listKeys" {
type = "Microsoft.Storage/storageAccounts@2022-09-01"
resource_id = azapi_resource.storageAccount.id
action = "listKeys"
response_export_values = ["*"]
}
data "azapi_resource" "blobService" {
type = "Microsoft.Storage/storageAccounts/blobServices@2022-09-01"
parent_id = azapi_resource.storageAccount.id
name = "default"
}
resource "azapi_resource" "container" {
type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01"
name = var.resource_name
parent_id = data.azapi_resource.blobService.id
body = {
properties = {
metadata = {
key = "value"
}
}
}
response_export_values = ["*"]
}
resource "azapi_resource" "workspace" {
type = "Microsoft.Synapse/workspaces@2021-06-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
identity {
type = "SystemAssigned"
identity_ids = []
}
body = {
properties = {
defaultDataLakeStorage = {
accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs
filesystem = azapi_resource.container.name
}
managedVirtualNetwork = ""
publicNetworkAccess = "Enabled"
sqlAdministratorLogin = var.sql_administrator_login
sqlAdministratorLoginPassword = var.sql_administrator_login_password
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "sqlPool" {
type = "Microsoft.Synapse/workspaces/sqlPools@2021-06-01"
parent_id = azapi_resource.workspace.id
name = var.resource_name
location = var.location
body = {
properties = {
createMode = "Default"
}
sku = {
name = "DW100c"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
資源格式
若要建立 Microsoft.Synapse/workspaces/sqlPools 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Synapse/workspaces/sqlPools@2021-03-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
collation = "string"
createMode = "string"
creationDate = "string"
maxSizeBytes = int
provisioningState = "string"
recoverableDatabaseId = "string"
restorePointInTime = "string"
sourceDatabaseId = "string"
status = "string"
storageAccountType = "string"
}
sku = {
capacity = int
name = "string"
tier = "string"
}
}
}
屬性值
Microsoft.Synapse/workspaces/sqlPools
| 名字 | 描述 | 價值 |
|---|---|---|
| 位置 | 資源所在的地理位置 | 字串 (必要) |
| 名字 | 資源名稱 | 字串 (必要) |
| parent_id | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:工作區 |
| 性能 | SQL 集區屬性 | SqlPoolResourceProperties |
| SKU | SQL 集區 SKU | Sku |
| 標籤 | 資源標籤 | 標記名稱和值的字典。 |
| 型別 | 資源類型 | “Microsoft.Synapse/workspaces/sqlPools@2021-03-01” |
Sku
| 名字 | 描述 | 價值 |
|---|---|---|
| 容量 | 如果 SKU 支援相應放大/縮小,則應該包含容量整數。 如果資源無法相應放大/縮小,可能會省略此專案。 | 整數 (int) |
| 名字 | SKU 名稱 | 字串 |
| 分層 | 服務層級 | 字串 |
SqlPoolResourceProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 定序 | 定序模式 | 字串 |
| createMode | 指定 sql 集區建立模式。 預設值:建立一般 SQL 集區。 PointInTimeRestore:藉由還原現有 sql 集區的時間點備份來建立 sql 集區。 sourceDatabaseId 必須指定為現有 sql 集區的資源識別碼,而且必須指定 restorePointInTime。 復原:藉由異地復寫備份建立 sql 集區。 sourceDatabaseId 必須指定為要還原的 recoverableDatabaseId。 還原:藉由還原已刪除 SQL 集區的備份來建立 sql 集區。 SourceDatabaseId 應該是 sql 集區的原始資源標識碼。 必須指定SourceDatabaseId和sourceDatabaseDeletionDate。 |
預設 'PointInTimeRestore' 'Recovery' 'Restore' |
| 創建日期 | 建立 SQL 集區的日期 | 字串 |
| maxSizeBytes | 位元組大小上限 | 整數 (int) |
| 佈建狀態 | 資源狀態 | 字串 |
| recoverableDatabaseId | 備份要從中還原的資料庫 | 字串 |
| restorePointInTime | 要還原的快照集時間 | 字串 |
| sourceDatabaseId | 要從中建立的源資料庫 | 字串 |
| 狀態 | 資源狀態 | 字串 |
| storageAccountType | 用來儲存此 sql 集區的備份的記憶體帳戶類型。 | 'GRS' 'LRS' 'ZRS' |
TrackedResourceTags
| 名字 | 描述 | 價值 |
|---|