- Latest
- 2024-11-01-preview
- 2024-05-01-preview
- 2023-08-01
- 2023-08-01-preview
- 2023-05-01-preview
- 2023-02-01-preview
- 2022-11-01-preview
- 2022-08-01-preview
- 2022-05-01-preview
- 2022-02-01-preview
- 2021-11-01
- 2021-11-01-preview
- 2021-08-01-preview
- 2021-05-01-preview
- 2021-02-01-preview
- 2020-11-01-preview
- 2020-08-01-preview
- 2020-02-02-preview
- 2017-10-01-preview
- 2014-04-01
Bicep 資源定義
伺服器/elasticPools 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Sql/servers/elasticPools 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Sql/servers/elasticPools@2024-11-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 | Value |
|---|---|---|
| 位置 | 資源位置。 | 字串 (必要) |
| name | 資源名稱 | 字串 (必要) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型的資源符號名稱:伺服器 |
| properties | 資源屬性。 | ElasticPoolProperties |
| sku | 彈性集區 SKU。 SKU 清單可能會因區域和支援供應項目而異。 若要判斷 Azure 區域中訂用帳戶可用的 SKU(包括 SKU 名稱、層/版本、系列和容量),請使用 Capabilities_ListByLocation REST API 或下列命令:```azurecli az sql elastic-pool list-editions -l location< -o >table ```` |
Sku |
| tags | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
ElasticPoolPerDatabaseSettings
| Name | Description | Value |
|---|---|---|
| autoPauseDelay | 集區內每個資料庫的自動暫停延遲 | int |
| maxCapacity | 任何一個資料庫都可以取用的最大容量。 | int |
| minCapacity | 保證所有資料庫的最小容量。 | int |
ElasticPoolProperties
| Name | Description | Value |
|---|---|---|
| autoPauseDelay | 彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停 | int |
| availabilityZone | 指定集區主要複本釘選到的可用性區域。 | '1' '2' '3' 'NoPreference' |
| highAvailabilityReplicaCount | 與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。 | int |
| licenseType | 要套用此彈性集區的授權類型。 | 'BasePrice' 'LicenseIncluded' |
| maintenanceConfigurationId | 指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。 | 字串 |
| maxSizeBytes | 資料庫彈性集區的記憶體限制,以位元組為單位。 | int |
| minCapacity | 如果未暫停,無伺服器集區的最小容量將不會縮小到下方 | int |
| perDatabaseSettings | 彈性集區的每個資料庫設定。 | ElasticPoolPerDatabaseSettings |
| preferredEnclaveType | 彈性集區上要求的記憶體保護區類型。 | 'Default' 'VBS' |
| zoneRedundant | 此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。 | bool |
Sku
| Name | Description | Value |
|---|---|---|
| 容量 | 特定 SKU 的容量。 | int |
| family | 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 | 字串 |
| name | SKU 的名稱,通常是字母 + 數位碼,例如 P3。 | 字串 (必要) |
| size | 特定 SKU 的大小 | 字串 |
| 分層 | 特定 SKU 的階層或版本,例如基本、進階。 | 字串 |
TrackedResourceTags
| Name | Description | Value |
|---|
使用範例
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: null
minimalTlsVersion: '1.2'
publicNetworkAccess: 'Enabled'
restrictOutboundNetworkAccess: 'Disabled'
version: '12.0'
}
}
resource elasticPool 'Microsoft.Sql/servers/elasticPools@2020-11-01-preview' = {
parent: server
name: resourceName
location: location
properties: {
maintenanceConfigurationId: resourceId('Microsoft.Maintenance/publicMaintenanceConfigurations', 'SQL_Default')
maxSizeBytes: 5242880000
perDatabaseSettings: {
maxCapacity: 5
minCapacity: 0
}
zoneRedundant: false
}
sku: {
capacity: 50
family: ''
name: 'BasicPool'
tier: 'Basic'
}
}
ARM 樣本資源定義
伺服器/elasticPools 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Sql/servers/elasticPools 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Sql/servers/elasticPools",
"apiVersion": "2024-11-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 | Value |
|---|---|---|
| apiVersion | API 版本 | '2024-11-01-preview' |
| 位置 | 資源位置。 | 字串 (必要) |
| name | 資源名稱 | 字串 (必要) |
| properties | 資源屬性。 | ElasticPoolProperties |
| sku | 彈性集區 SKU。 SKU 清單可能會因區域和支援供應項目而異。 若要判斷 Azure 區域中訂用帳戶可用的 SKU(包括 SKU 名稱、層/版本、系列和容量),請使用 Capabilities_ListByLocation REST API 或下列命令:```azurecli az sql elastic-pool list-editions -l location< -o >table ```` |
Sku |
| tags | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 | 資源類型 | 'Microsoft.Sql/servers/elasticPools' |
ElasticPoolPerDatabaseSettings
| Name | Description | Value |
|---|---|---|
| autoPauseDelay | 集區內每個資料庫的自動暫停延遲 | int |
| maxCapacity | 任何一個資料庫都可以取用的最大容量。 | int |
| minCapacity | 保證所有資料庫的最小容量。 | int |
ElasticPoolProperties
| Name | Description | Value |
|---|---|---|
| autoPauseDelay | 彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停 | int |
| availabilityZone | 指定集區主要複本釘選到的可用性區域。 | '1' '2' '3' 'NoPreference' |
| highAvailabilityReplicaCount | 與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。 | int |
| licenseType | 要套用此彈性集區的授權類型。 | 'BasePrice' 'LicenseIncluded' |
| maintenanceConfigurationId | 指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。 | 字串 |
| maxSizeBytes | 資料庫彈性集區的記憶體限制,以位元組為單位。 | int |
| minCapacity | 如果未暫停,無伺服器集區的最小容量將不會縮小到下方 | int |
| perDatabaseSettings | 彈性集區的每個資料庫設定。 | ElasticPoolPerDatabaseSettings |
| preferredEnclaveType | 彈性集區上要求的記憶體保護區類型。 | 'Default' 'VBS' |
| zoneRedundant | 此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。 | bool |
Sku
| Name | Description | Value |
|---|---|---|
| 容量 | 特定 SKU 的容量。 | int |
| family | 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 | 字串 |
| name | SKU 的名稱,通常是字母 + 數位碼,例如 P3。 | 字串 (必要) |
| size | 特定 SKU 的大小 | 字串 |
| 分層 | 特定 SKU 的階層或版本,例如基本、進階。 | 字串 |
TrackedResourceTags
| Name | Description | Value |
|---|
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
| Template | Description |
|---|---|
|
部署新的 SQL 彈性集區 |
此範本可讓您使用新的相關聯的 SQL Server 和新的 SQL Database 來部署新的 SQL 彈性集區,並將其指派給它。 |
Terraform (AzAPI 提供者) 資源定義
伺服器/elasticPools 資源類型可以使用目標作業來部署:
- 資源群組
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Sql/servers/elasticPools 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Sql/servers/elasticPools@2024-11-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 | Value |
|---|---|---|
| 位置 | 資源位置。 | 字串 (必要) |
| name | 資源名稱 | 字串 (必要) |
| parent_id | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:伺服器 |
| properties | 資源屬性。 | ElasticPoolProperties |
| sku | 彈性集區 SKU。 SKU 清單可能會因區域和支援供應項目而異。 若要判斷 Azure 區域中訂用帳戶可用的 SKU(包括 SKU 名稱、層/版本、系列和容量),請使用 Capabilities_ListByLocation REST API 或下列命令:```azurecli az sql elastic-pool list-editions -l location< -o >table ```` |
Sku |
| tags | 資源標籤 | 標記名稱和值的字典。 |
| 型別 | 資源類型 | 「Microsoft.Sql/servers/elasticPools@2024-11-01-preview」 |
ElasticPoolPerDatabaseSettings
| Name | Description | Value |
|---|---|---|
| autoPauseDelay | 集區內每個資料庫的自動暫停延遲 | int |
| maxCapacity | 任何一個資料庫都可以取用的最大容量。 | int |
| minCapacity | 保證所有資料庫的最小容量。 | int |
ElasticPoolProperties
| Name | Description | Value |
|---|---|---|
| autoPauseDelay | 彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停 | int |
| availabilityZone | 指定集區主要複本釘選到的可用性區域。 | '1' '2' '3' 'NoPreference' |
| highAvailabilityReplicaCount | 與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。 | int |
| licenseType | 要套用此彈性集區的授權類型。 | 'BasePrice' 'LicenseIncluded' |
| maintenanceConfigurationId | 指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。 | 字串 |
| maxSizeBytes | 資料庫彈性集區的記憶體限制,以位元組為單位。 | int |
| minCapacity | 如果未暫停,無伺服器集區的最小容量將不會縮小到下方 | int |
| perDatabaseSettings | 彈性集區的每個資料庫設定。 | ElasticPoolPerDatabaseSettings |
| preferredEnclaveType | 彈性集區上要求的記憶體保護區類型。 | 'Default' 'VBS' |
| zoneRedundant | 此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。 | bool |
Sku
| Name | Description | Value |
|---|---|---|
| 容量 | 特定 SKU 的容量。 | int |
| family | 如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。 | 字串 |
| name | SKU 的名稱,通常是字母 + 數位碼,例如 P3。 | 字串 (必要) |
| size | 特定 SKU 的大小 | 字串 |
| 分層 | 特定 SKU 的階層或版本,例如基本、進階。 | 字串 |
TrackedResourceTags
| Name | Description | Value |
|---|
使用範例
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 = ["*"]
}