Microsoft.DBforMySQL 伺服器
Bicep 資源定義
伺服器資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
資源格式
若要建立 Microsoft.DBforMySQL/servers 資源,請將下列 Bicep 新增至您的範本。
resource symbolicname 'Microsoft.DBforMySQL/servers@2017-12-01' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
{customized property}: 'string'
sku: {
capacity: int
family: 'string'
name: 'string'
size: 'string'
tier: 'string'
}
identity: {
type: 'SystemAssigned'
}
properties: {
infrastructureEncryption: 'string'
minimalTlsVersion: 'string'
publicNetworkAccess: 'string'
sslEnforcement: 'string'
storageProfile: {
backupRetentionDays: int
geoRedundantBackup: 'string'
storageAutogrow: 'string'
storageMB: int
}
version: 'string'
createMode: 'string'
// For remaining properties, see ServerPropertiesForCreateOrServerProperties objects
}
}
ServerPropertiesForCreateOrServerProperties 物件
設定 createMode 屬性以指定物件的類型。
針對 [預設],請使用:
createMode: 'Default'
administratorLogin: 'string'
administratorLoginPassword: 'string'
針對 GeoRestore,請使用:
createMode: 'GeoRestore'
sourceServerId: 'string'
針對 PointInTimeRestore,請使用:
createMode: 'PointInTimeRestore'
restorePointInTime: 'string'
sourceServerId: 'string'
針對 複本,請使用:
注意
使用範本建立具有 複 本值的 MySQL 伺服器不是等冪的。 第一次成功建立伺服器。 不過,當復本伺服器已經存在時部署範本會傳回錯誤。
createMode: 'Replica'
sourceServerId: 'string'
屬性值
servers
名稱 | 描述 | 值 |
---|---|---|
NAME | 資源名稱 | 字串 (必要) 字元限制:3-63 合法字元: 小寫字母、連字號和數字。 不能以連字號開頭或結尾。 資源名稱在 Azure 中必須是唯一的。 |
location | 資源所在的位置。 | 字串 (必要) |
tags | 索引鍵/值組形式的應用程式特有中繼資料。 | 標記名稱和值的字典。 請參閱 範本中的標記 |
sku | 伺服器的 SKU (定價層) 。 | Sku |
身分識別 | 伺服器的 Azure Active Directory 身分識別。 | ResourceIdentity |
properties | 伺服器的屬性。 | ServerPropertiesForCreateOrServerProperties (必要) |
ResourceIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 識別類型。 將此設定為 『SystemAssigned』,以便自動建立並指派資源的 Azure Active Directory 主體。 | 'SystemAssigned' |
ServerPropertiesForCreateOrServerProperties
名稱 | 描述 | 值 |
---|---|---|
infrastructureEncryption | 顯示伺服器是否已啟用基礎結構加密的狀態。 | 'Disabled' 'Enabled' |
minimalTlsVersion | 為伺服器強制執行最低 Tls 版本。 | 'TLS1_0' 'TLS1_1' 'TLS1_2' 'TLSEnforcementDisabled' |
publicNetworkAccess | 是否允許此伺服器的公用網路存取。 值是選擇性的,但如果傳入,則必須是 'Enabled' 或 'Disabled' | 'Disabled' 'Enabled' |
sslEnforcement | 在連線到伺服器時啟用 SSL 強制。 | 'Disabled' 'Enabled' |
storageProfile | 伺服器的記憶體配置檔。 | StorageProfile |
version | 伺服器版本。 | '5.6' '5.7' '8.0' |
createMode | 設定物件類型 | 預設值 GeoRestore PointInTimeRestore 需要複 本 () |
StorageProfile
名稱 | 描述 | 值 |
---|---|---|
backupRetentionDays | 伺服器的備份保留天數。 | int |
geoRedundantBackup | 針對伺服器備份啟用異地備援或不啟用。 | 'Disabled' 'Enabled' |
storageAutogrow | 啟用記憶體自動成長。 | 'Disabled' 'Enabled' |
storageMB | 伺服器允許的最大記憶體。 | int |
ServerPropertiesForDefaultCreate
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 需要 『Default』 () |
administratorLogin | 伺服器的系統管理員登入名稱。 只有在建立伺服器 (且建立) 時才能指定。 更新密碼時需要登入名稱。 | 字串 (必要) |
administratorLoginPassword | 系統管理員登入的密碼。 | 字串 (必要) 約束: 敏感性值。 以安全參數的形式傳入。 |
ServerPropertiesForGeoRestore
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 需要 'GeoRestore' () |
sourceServerId | 要從中還原的來源伺服器標識碼。 | 字串 (必要) |
ServerPropertiesForRestore
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 'PointInTimeRestore' (必要) |
restorePointInTime | 還原點建立時間 (ISO8601 格式) ,指定要從中還原的時間。 | 字串 (必要) |
sourceServerId | 要從中還原的來源伺服器標識碼。 | 字串 (必要) |
ServerPropertiesForReplica
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 需要 『Replica』 () |
sourceServerId | 要從中建立複本的主伺服器標識碼。 | 字串 (必要) |
SKU
名稱 | 描述 | 值 |
---|---|---|
處理能力 | 相應增加/放大容量,代表伺服器的計算單位。 | int 約束: 最小值 = 0 |
family | 硬體系列。 | 字串 |
NAME | sku 的名稱,通常是階層 + 系列 + 核心,例如B_Gen4_1、GP_Gen5_8。 | 字串 (必要) |
{1}size{2} | 要視需要由資源解譯的大小代碼。 | 字串 |
tier | 特定 SKU 的層,例如基本層。 | 'Basic' 'GeneralPurpose' 'MemoryOptimized' |
快速入門範本
下列快速入門範本會部署此資源類型。
範本 | 描述 |
---|---|
Buffalo Web 應用程式 |
開始在 Azure 上快速且便宜地執行 Golang Buffalo 應用程式。 |
使用 Jenkins 和 Azure Web Apps 的 Java CI/CD |
這是使用 Jenkins 和 Azure Web Apps 的 Java CI/CD 範例。 |
使用 VNet 部署 適用於 MySQL 的 Azure 資料庫 |
此範本提供部署適用於 MySQL 的 Azure 資料庫與 VNet 整合的方式。 |
具有IP限制的Web應用程式 應用程式閘道 |
此範本會在 Azure Web 應用程式前面建立應用程式閘道,並在 Web 應用程式上啟用 IP 限制。 |
使用適用於 MySQL 的 Azure 資料庫在 Linux 上建置 Web 應用程式 |
此範本提供在 Linux 上使用適用於 MySQL 的 Azure 資料庫在 Linux 上部署 Web Apps 的方法。 |
使用 MySQL 在 Linux 上使用 Sonarqube Docker Web 應用程式 |
此範本提供在適用於 MySQL 的 Azure 資料庫上部署 Sonarqube docker 映射 (alpine 卷標) 的簡單方式 |
適用於 MySQL 的 Azure 資料庫 Web 應用程式 |
此範本可讓您輕鬆地在適用於 MySQL 的 Azure 資料庫 Azure App 服務 Web Apps 上部署 Web 應用程式。 |
ARM 範本資源定義
伺服器資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
資源格式
若要建立 Microsoft.DBforMySQL/servers 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.DBforMySQL/servers",
"apiVersion": "2017-12-01",
"name": "string",
"location": "string",
"tags": {
"tagName1": "tagValue1",
"tagName2": "tagValue2"
},
"{customized property}": "string"
"sku": {
"capacity": "int",
"family": "string",
"name": "string",
"size": "string",
"tier": "string"
},
"identity": {
"type": "SystemAssigned"
},
"properties": {
"infrastructureEncryption": "string",
"minimalTlsVersion": "string",
"publicNetworkAccess": "string",
"sslEnforcement": "string",
"storageProfile": {
"backupRetentionDays": "int",
"geoRedundantBackup": "string",
"storageAutogrow": "string",
"storageMB": "int"
},
"version": "string",
"createMode": "string"
// For remaining properties, see ServerPropertiesForCreateOrServerProperties objects
}
}
ServerPropertiesForCreateOrServerProperties 物件
設定 createMode 屬性以指定物件的類型。
針對 [預設],請使用:
"createMode": "Default",
"administratorLogin": "string",
"administratorLoginPassword": "string"
針對 GeoRestore,請使用:
"createMode": "GeoRestore",
"sourceServerId": "string"
針對 PointInTimeRestore,請使用:
"createMode": "PointInTimeRestore",
"restorePointInTime": "string",
"sourceServerId": "string"
針對 複本,請使用:
注意
使用範本建立具有 複 本值的 MySQL 伺服器不是等冪的。 第一次成功建立伺服器。 不過,當復本伺服器已經存在時部署範本會傳回錯誤。
"createMode": "Replica",
"sourceServerId": "string"
屬性值
servers
名稱 | 描述 | 值 |
---|---|---|
類型 | 資源類型 | 'Microsoft.DBforMySQL/servers' |
apiVersion | 資源 API 版本 | '2017-12-01' |
NAME | 資源名稱 | 字串 (必要) 字元限制:3-63 合法字元: 小寫字母、連字號和數字。 不能以連字號開頭或結尾。 資源名稱在 Azure 中必須是唯一的。 |
location | 資源所在的位置。 | 字串 (必要) |
tags | 索引鍵/值組形式的應用程式特有中繼資料。 | 標記名稱和值的字典。 請參閱 範本中的標記 |
sku | 伺服器的 SKU (定價層) 。 | Sku |
身分識別 | 伺服器的 Azure Active Directory 身分識別。 | ResourceIdentity |
properties | 伺服器的屬性。 | ServerPropertiesForCreateOrServerProperties (必要) |
ResourceIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 識別類型。 將此設定為 『SystemAssigned』,以便自動建立並指派資源的 Azure Active Directory 主體。 | 'SystemAssigned' |
ServerPropertiesForCreateOrServerProperties
名稱 | 描述 | 值 |
---|---|---|
infrastructureEncryption | 顯示伺服器是否已啟用基礎結構加密的狀態。 | 'Disabled' 'Enabled' |
minimalTlsVersion | 為伺服器強制執行最低 Tls 版本。 | 'TLS1_0' 'TLS1_1' 'TLS1_2' 'TLSEnforcementDisabled' |
publicNetworkAccess | 是否允許此伺服器的公用網路存取。 值是選擇性的,但如果傳入,則必須是 'Enabled' 或 'Disabled' | 'Disabled' 'Enabled' |
sslEnforcement | 在連線到伺服器時啟用 SSL 強制。 | 'Disabled' 'Enabled' |
storageProfile | 伺服器的記憶體配置檔。 | StorageProfile |
version | 伺服器版本。 | '5.6' '5.7' '8.0' |
createMode | 設定物件類型 | 預設值 GeoRestore PointInTimeRestore 需要複本 () |
StorageProfile
名稱 | 描述 | 值 |
---|---|---|
backupRetentionDays | 伺服器的備份保留天數。 | int |
geoRedundantBackup | 針對伺服器備份啟用異地備援或不啟用。 | 'Disabled' 'Enabled' |
storageAutogrow | 啟用記憶體自動成長。 | 'Disabled' 'Enabled' |
storageMB | 伺服器允許的最大記憶體。 | int |
ServerPropertiesForDefaultCreate
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 必要) 'Default' ( |
administratorLogin | 伺服器的系統管理員登入名稱。 只有在建立伺服器 (且建立) 時,才能指定。 更新密碼時,需要登入名稱。 | 需要字串 () |
administratorLoginPassword | 系統管理員登入的密碼。 | 需要字串 () 約束: 敏感性值。 以安全參數的形式傳入。 |
ServerPropertiesForGeoRestore
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 'GeoRestore' (必要) |
sourceServerId | 要從中還原的來源伺服器標識碼。 | 需要字串 () |
ServerPropertiesForRestore
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 需要 'PointInTimeRestore' () |
restorePointInTime | 還原點建立時間 (ISO8601 格式) ,指定要還原的時間。 | 需要字串 () |
sourceServerId | 要從中還原的來源伺服器標識碼。 | 需要字串 () |
ServerPropertiesForReplica
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 'Replica' (必要) |
sourceServerId | 要從中建立複本的主伺服器標識碼。 | 需要字串 () |
SKU
名稱 | 描述 | 值 |
---|---|---|
處理能力 | 相應增加/放大容量,代表伺服器的計算單位。 | int 約束: 最小值 = 0 |
family | 硬體系列。 | 字串 |
NAME | sku 的名稱,通常是階層 + 系列 + 核心,例如B_Gen4_1,GP_Gen5_8。 | 需要字串 () |
{1}size{2} | 要適當地由資源解譯的大小程序代碼。 | 字串 |
tier | 特定 SKU 的層級,例如基本層。 | 'Basic' 'GeneralPurpose' 'MemoryOptimized' |
快速入門範本
下列快速入門範本會部署此資源類型。
範本 | 描述 |
---|---|
Buffalo Web 應用程式 |
開始在 Azure 上快速且便宜地執行 Golang Buffalo 應用程式。 |
使用 Jenkins 和 Azure Web Apps 的 Java CI/CD |
這是使用 Jenkins 和 Azure Web Apps 的 Java CI/CD 範例。 |
使用 VNet 部署 適用於 MySQL 的 Azure 資料庫 |
此範本提供部署適用於 MySQL 的 Azure 資料庫與 VNet 整合的方式。 |
具有IP限制的Web應用程式 應用程式閘道 |
此範本會在 Azure Web 應用程式前面建立應用程式閘道,並在 Web 應用程式上啟用 IP 限制。 |
使用適用於 MySQL 的 Azure 資料庫在 Linux 上建置 Web 應用程式 |
此範本提供在 Linux 上使用適用於 MySQL 的 Azure 資料庫在 Linux 上部署 Web Apps 的方法。 |
使用 MySQL 在 Linux 上使用 Sonarqube Docker Web 應用程式 |
此範本提供在適用於 MySQL 的 Azure 資料庫上部署 Sonarqube docker 映射 (alpine 卷標) 的簡單方式 |
適用於 MySQL 的 Azure 資料庫 Web 應用程式 |
此範本可讓您輕鬆地在適用於 MySQL 的 Azure 資料庫 Azure App 服務 Web Apps 上部署 Web 應用程式。 |
Terraform (AzAPI 提供者) 資源定義
伺服器資源類型可以使用目標作業來部署:
- 資源群組
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
資源格式
若要建立 Microsoft.DBforMySQL/servers 資源,請將下列 Terraform 新增至您的範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DBforMySQL/servers@2017-12-01"
name = "string"
location = "string"
parent_id = "string"
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
{customized property} = "string"
identity {
type = "SystemAssigned"
}
body = jsonencode({
properties = {
infrastructureEncryption = "string"
minimalTlsVersion = "string"
publicNetworkAccess = "string"
sslEnforcement = "string"
storageProfile = {
backupRetentionDays = int
geoRedundantBackup = "string"
storageAutogrow = "string"
storageMB = int
}
version = "string"
createMode = "string"
// For remaining properties, see ServerPropertiesForCreateOrServerProperties objects
}
sku = {
capacity = int
family = "string"
name = "string"
size = "string"
tier = "string"
}
})
}
ServerPropertiesForCreateOrServerProperties 物件
設定 createMode 屬性以指定物件的類型。
針對 [預設],請使用:
createMode = "Default"
administratorLogin = "string"
administratorLoginPassword = "string"
針對 GeoRestore,請使用:
createMode = "GeoRestore"
sourceServerId = "string"
針對 PointInTimeRestore,請使用:
createMode = "PointInTimeRestore"
restorePointInTime = "string"
sourceServerId = "string"
針對 複本,請使用:
注意
使用範本建立具有 複 本值的 MySQL 伺服器不是等冪的。 第一次成功建立伺服器。 不過,當復本伺服器已經存在時部署範本會傳回錯誤。
createMode = "Replica"
sourceServerId = "string"
屬性值
servers
名稱 | 描述 | 值 |
---|---|---|
類型 | 資源類型 | “Microsoft.DBforMySQL/servers@2017-12-01” |
NAME | 資源名稱 | 字串 (必要) 字元限制:3-63 合法字元: 小寫字母、連字號和數字。 不能以連字號開頭或結尾。 資源名稱在 Azure 中必須是唯一的。 |
location | 資源所在的位置。 | 字串 (必要) |
parent_id | 若要部署至資源群組,請使用該資源群組的標識碼。 | 字串 (必要) |
tags | 索引鍵/值組形式的應用程式特有中繼資料。 | 標記名稱和值的字典。 |
sku | 伺服器的 SKU (定價層) 。 | Sku |
身分識別 | 伺服器的 Azure Active Directory 身分識別。 | ResourceIdentity |
properties | 伺服器的屬性。 | ServerPropertiesForCreateOrServerProperties (必要) |
ResourceIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 識別類型。 將此設定為 『SystemAssigned』,以便自動建立並指派資源的 Azure Active Directory 主體。 | “SystemAssigned” |
ServerPropertiesForCreateOrServerProperties
名稱 | 描述 | 值 |
---|---|---|
infrastructureEncryption | 顯示伺服器是否已啟用基礎結構加密的狀態。 | “Disabled” “Enabled” |
minimalTlsVersion | 為伺服器強制執行最低 Tls 版本。 | “TLS1_0” “TLS1_1” “TLS1_2” “TLSEnforcementDisabled” |
publicNetworkAccess | 此伺服器是否允許公用網路存取。 值是選擇性的,但如果傳入,則必須是 'Enabled' 或 'Disabled' | “Disabled” “Enabled” |
sslEnforcement | 在連線到伺服器時啟用 SSL 強制執行。 | “Disabled” “Enabled” |
storageProfile | 伺服器的記憶體配置檔。 | StorageProfile |
version | 伺服器版本。 | "5.6" "5.7" "8.0" |
createMode | 設定物件類型 | 預設值 GeoRestore PointInTimeRestore 需要複本 () |
StorageProfile
名稱 | 描述 | 值 |
---|---|---|
backupRetentionDays | 伺服器的備份保留天數。 | int |
geoRedundantBackup | 針對伺服器備份啟用異地備援或不啟用。 | “Disabled” “Enabled” |
storageAutogrow | 啟用記憶體自動成長。 | “Disabled” “Enabled” |
storageMB | 伺服器允許的最大記憶體。 | int |
ServerPropertiesForDefaultCreate
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | “Default” (必要) |
administratorLogin | 伺服器的系統管理員登入名稱。 只有在建立伺服器 (且建立) 時,才能指定。 更新密碼時,需要登入名稱。 | 需要字串 () |
administratorLoginPassword | 系統管理員登入的密碼。 | 需要字串 () 約束: 敏感性值。 以安全參數的形式傳入。 |
ServerPropertiesForGeoRestore
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | “GeoRestore” (必要) |
sourceServerId | 要從中還原的來源伺服器標識碼。 | 需要字串 () |
ServerPropertiesForRestore
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | “PointInTimeRestore” (必要) |
restorePointInTime | 還原點建立時間 (ISO8601 格式) ,指定要還原的時間。 | 需要字串 () |
sourceServerId | 要從中還原的來源伺服器標識碼。 | 需要字串 () |
ServerPropertiesForReplica
名稱 | 描述 | 值 |
---|---|---|
createMode | 建立新伺服器的模式。 | 「複本」 (必要) |
sourceServerId | 要從中建立複本的主伺服器標識碼。 | 需要字串 () |
SKU
名稱 | 描述 | 值 |
---|---|---|
處理能力 | 相應增加/放大容量,代表伺服器的計算單位。 | int 約束: 最小值 = 0 |
family | 硬體系列。 | 字串 |
NAME | sku 的名稱,通常是階層 + 系列 + 核心,例如B_Gen4_1,GP_Gen5_8。 | 需要字串 () |
{1}size{2} | 要適當地由資源解譯的大小程序代碼。 | 字串 |
tier | 特定 SKU 的層級,例如基本層。 | "Basic" “GeneralPurpose” “MemoryOptimized” |
意見反應
https://aka.ms/ContentUserFeedback。
即將推出:在 2024 年,我們將隨著內容的意見反應機制逐步淘汰 GitHub 問題,並以新的意見反應系統來取代。 如需詳細資訊,請參閱提交並檢視相關的意見反應