Microsoft.SQL servers/elasticPools 2025-08-01-preview

Bicep 資源定義

伺服器/elasticPools 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

使用範例

Bicep 範例

部署 Azure SQL 彈性池的基本範例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator login password for the SQL server')
param administratorLoginPassword string

resource server 'Microsoft.Sql/servers@2021-02-01-preview' = {
  name: resourceName
  location: location
  properties: {
    administratorLogin: '4dm1n157r470r'
    administratorLoginPassword: administratorLoginPassword
    minimalTlsVersion: '1.2'
    publicNetworkAccess: 'Enabled'
    restrictOutboundNetworkAccess: 'Disabled'
    version: '12.0'
  }
}

resource elasticPool 'Microsoft.Sql/servers/elasticPools@2020-11-01-preview' = {
  name: resourceName
  location: location
  parent: server
  sku: {
    capacity: 50
    family: ''
    name: 'BasicPool'
    tier: 'Basic'
  }
  properties: {
    maintenanceConfigurationId: resourceId('Microsoft.Maintenance/publicMaintenanceConfigurations', 'SQL_Default')
    maxSizeBytes: 5242880000
    perDatabaseSettings: {
      maxCapacity: 5
      minCapacity: 0
    }
    zoneRedundant: false
  }
}

Azure 已驗證的模組

下列 Azure 驗證模組 可用來部署此資源類型。

Module Description
Azure SQL Server - 彈性池 AVM Child Module for Azure SQL Server - Elastic Pool

資源格式

創造一個 Microsoft。Sql/servers/elasticPools 資源,請在你的範本中加入以下 Bicep。

resource symbolicname 'Microsoft.Sql/servers/elasticPools@2025-08-01-preview' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    autoPauseDelay: int
    availabilityZone: 'string'
    highAvailabilityReplicaCount: int
    licenseType: 'string'
    maintenanceConfigurationId: 'string'
    maxSizeBytes: int
    minCapacity: int
    perDatabaseSettings: {
      autoPauseDelay: int
      maxCapacity: int
      minCapacity: int
    }
    preferredEnclaveType: 'string'
    zoneRedundant: bool
  }
  sku: {
    capacity: int
    family: 'string'
    name: 'string'
    size: 'string'
    tier: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

Microsoft.Sql/servers/elasticPools

Name Description 價值觀
位置 資源所在的地理位置 字串 (必要)
名字 資源名稱 字串 (必要)
父代 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型的資源符號名稱:伺服器
properties 資源屬性。 ElasticPoolProperties
sku 彈性集區 SKU。

SKU 清單可能會因區域和支援供應項目而異。 若要判斷 Azure 區域中訂用帳戶可用的 SKU(包括 SKU 名稱、層/版本、系列和容量),請使用 Capabilities_ListByLocation REST API 或下列命令:

azurecli<br />az sql elastic-pool list-editions -l &lt;location&gt; -o table<br />
Sku
tags 資源標籤 標記名稱和值的字典。 請參考模板中的標籤

ElasticPoolPerDatabaseSettings

Name Description 價值觀
autoPauseDelay 集區內每個資料庫的自動暫停延遲 整數 (int)
最大容量 任何一個資料庫都可以取用的最大容量。 整數 (int)
最小容量 保證所有資料庫的最小容量。 整數 (int)

ElasticPoolProperties

Name Description 價值觀
autoPauseDelay 彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停 整數 (int)
可用性區域 指定集區主要複本釘選到的可用性區域。 '1'
'2'
'3'
“無偏好”
highAvailabilityReplicaCount 與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。 整數 (int)
licenseType 要套用此彈性集區的授權類型。 'BasePrice'
'LicenseIncluded'
maintenanceConfigurationId 指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。 字串
maxSizeBytes 資料庫彈性集區的記憶體限制,以位元組為單位。 整數 (int)
最小容量 如果未暫停,無伺服器集區的最小容量將不會縮小到下方 整數 (int)
perDatabaseSettings 彈性集區的每個資料庫設定。 ElasticPoolPerDatabaseSettings
preferredEnclaveType 彈性集區上要求的記憶體保護區類型。 'Default'
'VBS'
區域冗餘 此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。 布爾 (bool)

Sku

Name Description 價值觀
容量 特定 SKU 的容量。 整數 (int)
family 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 字串
名字 SKU 的名稱,通常是字母 + 數位碼,例如 P3。 字串 (必要)
size 特定 SKU 的大小 字串
分層 特定 SKU 的階層或版本,例如基本、進階。 字串

TrackedResourceTags

Name Description 價值觀

ARM 樣本資源定義

伺服器/elasticPools 資源類型可以使用目標作業來部署:

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

Template Description
部署新的 SQL 彈性池

部署至Azure
此範本允許您部署新的 SQL 彈性池,並附帶其新關聯的 SQL Server 及可指派的新 SQL 資料庫。

資源格式

創造一個 Microsoft。Sql/servers/elasticPools 資源,請將以下 JSON 加入你的範本。

{
  "type": "Microsoft.Sql/servers/elasticPools",
  "apiVersion": "2025-08-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "autoPauseDelay": "int",
    "availabilityZone": "string",
    "highAvailabilityReplicaCount": "int",
    "licenseType": "string",
    "maintenanceConfigurationId": "string",
    "maxSizeBytes": "int",
    "minCapacity": "int",
    "perDatabaseSettings": {
      "autoPauseDelay": "int",
      "maxCapacity": "int",
      "minCapacity": "int"
    },
    "preferredEnclaveType": "string",
    "zoneRedundant": "bool"
  },
  "sku": {
    "capacity": "int",
    "family": "string",
    "name": "string",
    "size": "string",
    "tier": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

Microsoft.Sql/servers/elasticPools

Name Description 價值觀
apiVersion API 版本 “2025-08-01-預覽”
位置 資源所在的地理位置 字串 (必要)
名字 資源名稱 字串 (必要)
properties 資源屬性。 ElasticPoolProperties
sku 彈性集區 SKU。

SKU 清單可能會因區域和支援供應項目而異。 若要判斷 Azure 區域中訂用帳戶可用的 SKU(包括 SKU 名稱、層/版本、系列和容量),請使用 Capabilities_ListByLocation REST API 或下列命令:

azurecli<br />az sql elastic-pool list-editions -l &lt;location&gt; -o table<br />
Sku
tags 資源標籤 標記名稱和值的字典。 請參考模板中的標籤
型別 資源類型 “Microsoft.Sql/servers/elasticPools”

ElasticPoolPerDatabaseSettings

Name Description 價值觀
autoPauseDelay 集區內每個資料庫的自動暫停延遲 整數 (int)
最大容量 任何一個資料庫都可以取用的最大容量。 整數 (int)
最小容量 保證所有資料庫的最小容量。 整數 (int)

ElasticPoolProperties

Name Description 價值觀
autoPauseDelay 彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停 整數 (int)
可用性區域 指定集區主要複本釘選到的可用性區域。 '1'
'2'
'3'
“無偏好”
highAvailabilityReplicaCount 與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。 整數 (int)
licenseType 要套用此彈性集區的授權類型。 'BasePrice'
'LicenseIncluded'
maintenanceConfigurationId 指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。 字串
maxSizeBytes 資料庫彈性集區的記憶體限制,以位元組為單位。 整數 (int)
最小容量 如果未暫停,無伺服器集區的最小容量將不會縮小到下方 整數 (int)
perDatabaseSettings 彈性集區的每個資料庫設定。 ElasticPoolPerDatabaseSettings
preferredEnclaveType 彈性集區上要求的記憶體保護區類型。 'Default'
'VBS'
區域冗餘 此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。 布爾 (bool)

Sku

Name Description 價值觀
容量 特定 SKU 的容量。 整數 (int)
family 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 字串
名字 SKU 的名稱,通常是字母 + 數位碼,例如 P3。 字串 (必要)
size 特定 SKU 的大小 字串
分層 特定 SKU 的階層或版本,例如基本、進階。 字串

TrackedResourceTags

Name Description 價值觀

Terraform (AzAPI 提供者) 資源定義

伺服器/elasticPools 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

部署 Azure SQL 彈性池的基本範例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
    azurerm = {
      source = "hashicorp/azurerm"
    }
  }
}

provider "azurerm" {
  features {
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

variable "administrator_login_password" {
  type        = string
  description = "The administrator login password for the SQL server"
  sensitive   = true
}

data "azurerm_client_config" "current" {
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "server" {
  type      = "Microsoft.Sql/servers@2021-02-01-preview"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      administratorLogin            = "4dm1n157r470r"
      administratorLoginPassword    = var.administrator_login_password
      minimalTlsVersion             = "1.2"
      publicNetworkAccess           = "Enabled"
      restrictOutboundNetworkAccess = "Disabled"
      version                       = "12.0"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

data "azapi_resource_id" "publicMaintenanceConfiguration" {
  type      = "Microsoft.Maintenance/publicMaintenanceConfigurations@2023-04-01"
  parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
  name      = "SQL_Default"
}

resource "azapi_resource" "elasticPool" {
  type      = "Microsoft.Sql/servers/elasticPools@2020-11-01-preview"
  parent_id = azapi_resource.server.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      maintenanceConfigurationId = data.azapi_resource_id.publicMaintenanceConfiguration.id
      maxSizeBytes               = 5.24288e+09
      perDatabaseSettings = {
        maxCapacity = 5
        minCapacity = 0
      }
      zoneRedundant = false
    }
    sku = {
      capacity = 50
      family   = ""
      name     = "BasicPool"
      tier     = "Basic"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

部署 Azure SQL 彈性池的基本範例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
    azurerm = {
      source = "hashicorp/azurerm"
    }
  }
}

provider "azurerm" {
  features {
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

variable "administrator_login_password" {
  type        = string
  description = "The administrator login password for the SQL server"
  sensitive   = true
}

data "azurerm_client_config" "current" {
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "server" {
  type      = "Microsoft.Sql/servers@2021-02-01-preview"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      administratorLogin            = "4dm1n157r470r"
      administratorLoginPassword    = var.administrator_login_password
      minimalTlsVersion             = "1.2"
      publicNetworkAccess           = "Enabled"
      restrictOutboundNetworkAccess = "Disabled"
      version                       = "12.0"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

data "azapi_resource_id" "publicMaintenanceConfiguration" {
  type      = "Microsoft.Maintenance/publicMaintenanceConfigurations@2023-04-01"
  parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
  name      = "SQL_Default"
}

resource "azapi_resource" "elasticPool" {
  type      = "Microsoft.Sql/servers/elasticPools@2020-11-01-preview"
  parent_id = azapi_resource.server.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      maintenanceConfigurationId = data.azapi_resource_id.publicMaintenanceConfiguration.id
      maxSizeBytes               = 5.24288e+09
      perDatabaseSettings = {
        maxCapacity = 5
        minCapacity = 0
      }
      zoneRedundant = false
    }
    sku = {
      capacity = 50
      family   = ""
      name     = "BasicPool"
      tier     = "Basic"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

資源格式

創造一個 Microsoft。Sql/servers/elasticPools 資源,將以下 Terraform 加入你的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Sql/servers/elasticPools@2025-08-01-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      autoPauseDelay = int
      availabilityZone = "string"
      highAvailabilityReplicaCount = int
      licenseType = "string"
      maintenanceConfigurationId = "string"
      maxSizeBytes = int
      minCapacity = int
      perDatabaseSettings = {
        autoPauseDelay = int
        maxCapacity = int
        minCapacity = int
      }
      preferredEnclaveType = "string"
      zoneRedundant = bool
    }
    sku = {
      capacity = int
      family = "string"
      name = "string"
      size = "string"
      tier = "string"
    }
  }
}

屬性值

Microsoft.Sql/servers/elasticPools

Name Description 價值觀
位置 資源所在的地理位置 字串 (必要)
名字 資源名稱 字串 (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:伺服器
properties 資源屬性。 ElasticPoolProperties
sku 彈性集區 SKU。

SKU 清單可能會因區域和支援供應項目而異。 若要判斷 Azure 區域中訂用帳戶可用的 SKU(包括 SKU 名稱、層/版本、系列和容量),請使用 Capabilities_ListByLocation REST API 或下列命令:

azurecli<br />az sql elastic-pool list-editions -l &lt;location&gt; -o table<br />
Sku
tags 資源標籤 標記名稱和值的字典。
型別 資源類型 「Microsoft。SQL/servers/elasticPools@2025-08-01-preview」

ElasticPoolPerDatabaseSettings

Name Description 價值觀
autoPauseDelay 集區內每個資料庫的自動暫停延遲 整數 (int)
最大容量 任何一個資料庫都可以取用的最大容量。 整數 (int)
最小容量 保證所有資料庫的最小容量。 整數 (int)

ElasticPoolProperties

Name Description 價值觀
autoPauseDelay 彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停 整數 (int)
可用性區域 指定集區主要複本釘選到的可用性區域。 '1'
'2'
'3'
“無偏好”
highAvailabilityReplicaCount 與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。 整數 (int)
licenseType 要套用此彈性集區的授權類型。 'BasePrice'
'LicenseIncluded'
maintenanceConfigurationId 指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。 字串
maxSizeBytes 資料庫彈性集區的記憶體限制,以位元組為單位。 整數 (int)
最小容量 如果未暫停,無伺服器集區的最小容量將不會縮小到下方 整數 (int)
perDatabaseSettings 彈性集區的每個資料庫設定。 ElasticPoolPerDatabaseSettings
preferredEnclaveType 彈性集區上要求的記憶體保護區類型。 'Default'
'VBS'
區域冗餘 此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。 布爾 (bool)

Sku

Name Description 價值觀
容量 特定 SKU 的容量。 整數 (int)
family 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 字串
名字 SKU 的名稱,通常是字母 + 數位碼,例如 P3。 字串 (必要)
size 特定 SKU 的大小 字串
分層 特定 SKU 的階層或版本,例如基本、進階。 字串

TrackedResourceTags

Name Description 價值觀