共用方式為


Microsoft.DBforMySQL 彈性Servers 2023-06-30

Bicep 資源定義

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

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

言論

只有在更新現有的彈性伺服器時,才使用 maintenanceWindow 屬性。 建立新的彈性伺服器時,請勿指定此屬性的值。

資源格式

若要建立 Microsoft.DBforMySQL/flexibleServers 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.DBforMySQL/flexibleServers@2023-06-30' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  sku: {
    name: 'string'
    tier: 'string'
  }
  identity: {
    type: 'UserAssigned'
    userAssignedIdentities: {
      {customized property}: any()
    }
  }
  properties: {
    administratorLogin: 'string'
    administratorLoginPassword: 'string'
    availabilityZone: 'string'
    backup: {
      backupRetentionDays: int
      geoRedundantBackup: 'string'
    }
    createMode: 'string'
    dataEncryption: {
      geoBackupKeyURI: 'string'
      geoBackupUserAssignedIdentityId: 'string'
      primaryKeyURI: 'string'
      primaryUserAssignedIdentityId: 'string'
      type: 'string'
    }
    highAvailability: {
      mode: 'string'
      standbyAvailabilityZone: 'string'
    }
    importSourceProperties: {
      dataDirPath: 'string'
      sasToken: 'string'
      storageType: 'AzureBlob'
      storageUrl: 'string'
    }
    maintenanceWindow: {
      customWindow: 'string'
      dayOfWeek: int
      startHour: int
      startMinute: int
    }
    network: {
      delegatedSubnetResourceId: 'string'
      privateDnsZoneResourceId: 'string'
      publicNetworkAccess: 'string'
    }
    replicationRole: 'string'
    restorePointInTime: 'string'
    sourceServerResourceId: 'string'
    storage: {
      autoGrow: 'string'
      autoIoScaling: 'string'
      iops: int
      logOnDisk: 'string'
      storageSizeGB: int
    }
    version: 'string'
  }
}

屬性值

flexibleServers

名字 描述 價值
名字 資源名稱 字串 (必要)
位置 資源所在的地理位置 字串 (必要)
標籤 資源標籤。 標記名稱和值的字典。 請參閱範本中的 標籤
sku 伺服器的 SKU(定價層)。 MySQLServerSku
身份 伺服器的 Cmk 身分識別。 MySQLServerIdentity
性能 伺服器的屬性。 ServerProperties

MySQLServerIdentity

名字 描述 價值
類型 受控服務識別的類型。 'UserAssigned'
userAssignedIdentities 使用者指派身分識別的元數據。 MySQLServerIdentityUserAssignedIdentities

MySQLServerIdentityUserAssignedIdentities

名字 描述 價值
{自定義屬性} 針對 Bicep,您可以使用 any() 函式。

ServerProperties

名字 描述 價值
administratorLogin 系統管理員的伺服器登入名稱。 只有在建立伺服器時才能指定 (而且是建立的必要專案)。 字串
administratorLoginPassword 系統管理員登入的密碼(建立伺服器所需的密碼)。 字串

約束:
敏感性值。 以安全參數的形式傳入。
availabilityZone 伺服器的可用性區域資訊。 字串
備份 備份伺服器的相關屬性。 備份
createMode 建立新 MySQL 伺服器的模式。 'Default'
'GeoRestore'
'PointInTimeRestore'
'Replica'
dataEncryption CMK 的數據加密。 DataEncryption
highAvailability 伺服器的高可用性相關屬性。 HighAvailability
importSourceProperties 從記憶體匯入的來源屬性。 ImportSourceProperties
maintenanceWindow 伺服器的維護時間範圍。 MaintenanceWindow
網路 伺服器的網路相關屬性。 網路
replicationRole 複寫角色。 'None'
'Replica'
'Source'
restorePointInTime 還原點建立時間(ISO8601格式),指定要還原的時間。 字串
sourceServerResourceId 來源 MySQL 伺服器識別碼。 字串
存儲 伺服器的記憶體相關屬性。 記憶體
版本 伺服器版本。 '5.7'
'8.0.21'

備份

名字 描述 價值
backupRetentionDays 伺服器的備份保留天數。 int
geoRedundantBackup 是否啟用異地備援備份。 'Disabled'
'Enabled'

DataEncryption

名字 描述 價值
geoBackupKeyURI 異地備份密鑰 URI 作為金鑰保存庫無法跨區域,需要在與異地備份相同的區域中使用 cmk 字串
geoBackupUserAssignedIdentityId 異地備份使用者身分識別資源標識碼作為身分識別無法跨區域,需要在與異地備份相同的區域中的身分識別 字串
primaryKeyURI 主鍵 URI 字串
primaryUserAssignedIdentityId 主要使用者身分識別資源標識碼 字串
類型 密鑰類型:啟用 cmk 的 AzureKeyVault、適用於停用 cmk 的 SystemManaged。 'AzureKeyVault'
'SystemManaged'

HighAvailability

名字 描述 價值
模式 伺服器的高可用性模式。 'Disabled'
'SameZone'
'ZoneRedundant'
standbyAvailabilityZone 待命伺服器的可用性區域。 字串

ImportSourceProperties

名字 描述 價值
dataDirPath 記憶體中資料目錄的相對路徑。 字串
sasToken 用於存取來源記憶體的 Sas 令牌。 SAS 令牌需要讀取和列表許可權。 字串

約束:
敏感性值。 以安全參數的形式傳入。
storageType 匯入來源的儲存類型。 'AzureBlob'
storageUrl 匯入來源記憶體的 URI。 字串

MaintenanceWindow

名字 描述 價值
customWindow 指出是否啟用或停用自定義視窗 字串
dayOfWeek 維護時段的星期數 int
startHour 維護時段的開始時間 int
startMinute 維護時段的開始分鐘 int

網路

名字 描述 價值
delegatedSubnetResourceId 用來為伺服器設定 vnet 的委派子網資源標識碼。 字串
privateDnsZoneResourceId 私人 DNS 區域資源識別碼。 字串
publicNetworkAccess 此伺服器是否允許公用網路存取。 當伺服器具有 VNet 整合時,值為 『Disabled』。 'Disabled'
'Enabled'

存儲

名字 描述 價值
autoGrow 啟用記憶體自動成長。 'Disabled'
'Enabled'
autoIoScaling 啟用 IO 自動調整。 'Disabled'
'Enabled'
iops 伺服器的記憶體 IOPS。 int
logOnDisk 啟用登入磁碟。 'Disabled'
'Enabled'
storageSizeGB 伺服器允許的記憶體大小上限。 int

MySQLServerSku

名字 描述 價值
名字 sku 的名稱,例如Standard_D32s_v3。 字串 (必要)
特定 SKU 的層級,例如 GeneralPurpose。 「高載」
'GeneralPurpose'
'MemoryOptimized' (必要)

快速入門範本

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

範本 描述
建立 MySqlFlex 伺服器 & 透過Backup Vault 啟用保護

部署至 Azure
建立 MySQL 彈性伺服器的範本,並透過備份保存庫啟用保護
使用私人端點部署 MySQL 彈性伺服器

部署至 Azure
此範本提供使用私人端點部署適用於 MySQL 的 Azure 資料庫彈性伺服器的方式。
使用 Vnet 整合部署 MySQL 彈性伺服器

部署至 Azure
此範本提供部署適用於 MySQL 彈性伺服器的 Azure 資料庫與 VNet 整合的方式。

ARM 樣本資源定義

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

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

言論

只有在更新現有的彈性伺服器時,才使用 maintenanceWindow 屬性。 建立新的彈性伺服器時,請勿指定此屬性的值。

資源格式

若要建立 Microsoft.DBforMySQL/flexibleServers 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.DBforMySQL/flexibleServers",
  "apiVersion": "2023-06-30",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "sku": {
    "name": "string",
    "tier": "string"
  },
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "{customized property}": {}
    }
  },
  "properties": {
    "administratorLogin": "string",
    "administratorLoginPassword": "string",
    "availabilityZone": "string",
    "backup": {
      "backupRetentionDays": "int",
      "geoRedundantBackup": "string"
    },
    "createMode": "string",
    "dataEncryption": {
      "geoBackupKeyURI": "string",
      "geoBackupUserAssignedIdentityId": "string",
      "primaryKeyURI": "string",
      "primaryUserAssignedIdentityId": "string",
      "type": "string"
    },
    "highAvailability": {
      "mode": "string",
      "standbyAvailabilityZone": "string"
    },
    "importSourceProperties": {
      "dataDirPath": "string",
      "sasToken": "string",
      "storageType": "AzureBlob",
      "storageUrl": "string"
    },
    "maintenanceWindow": {
      "customWindow": "string",
      "dayOfWeek": "int",
      "startHour": "int",
      "startMinute": "int"
    },
    "network": {
      "delegatedSubnetResourceId": "string",
      "privateDnsZoneResourceId": "string",
      "publicNetworkAccess": "string"
    },
    "replicationRole": "string",
    "restorePointInTime": "string",
    "sourceServerResourceId": "string",
    "storage": {
      "autoGrow": "string",
      "autoIoScaling": "string",
      "iops": "int",
      "logOnDisk": "string",
      "storageSizeGB": "int"
    },
    "version": "string"
  }
}

屬性值

flexibleServers

名字 描述 價值
類型 資源類型 'Microsoft.DBforMySQL/flexibleServers'
apiVersion 資源 API 版本 '2023-06-30'
名字 資源名稱 字串 (必要)
位置 資源所在的地理位置 字串 (必要)
標籤 資源標籤。 標記名稱和值的字典。 請參閱範本中的 標籤
sku 伺服器的 SKU(定價層)。 MySQLServerSku
身份 伺服器的 Cmk 身分識別。 MySQLServerIdentity
性能 伺服器的屬性。 ServerProperties

MySQLServerIdentity

名字 描述 價值
類型 受控服務識別的類型。 'UserAssigned'
userAssignedIdentities 使用者指派身分識別的元數據。 MySQLServerIdentityUserAssignedIdentities

MySQLServerIdentityUserAssignedIdentities

名字 描述 價值
{自定義屬性}

ServerProperties

名字 描述 價值
administratorLogin 系統管理員的伺服器登入名稱。 只有在建立伺服器時才能指定 (而且是建立的必要專案)。 字串
administratorLoginPassword 系統管理員登入的密碼(建立伺服器所需的密碼)。 字串

約束:
敏感性值。 以安全參數的形式傳入。
availabilityZone 伺服器的可用性區域資訊。 字串
備份 備份伺服器的相關屬性。 備份
createMode 建立新 MySQL 伺服器的模式。 'Default'
'GeoRestore'
'PointInTimeRestore'
'Replica'
dataEncryption CMK 的數據加密。 DataEncryption
highAvailability 伺服器的高可用性相關屬性。 HighAvailability
importSourceProperties 從記憶體匯入的來源屬性。 ImportSourceProperties
maintenanceWindow 伺服器的維護時間範圍。 MaintenanceWindow
網路 伺服器的網路相關屬性。 網路
replicationRole 複寫角色。 'None'
'Replica'
'Source'
restorePointInTime 還原點建立時間(ISO8601格式),指定要還原的時間。 字串
sourceServerResourceId 來源 MySQL 伺服器識別碼。 字串
存儲 伺服器的記憶體相關屬性。 記憶體
版本 伺服器版本。 '5.7'
'8.0.21'

備份

名字 描述 價值
backupRetentionDays 伺服器的備份保留天數。 int
geoRedundantBackup 是否啟用異地備援備份。 'Disabled'
'Enabled'

DataEncryption

名字 描述 價值
geoBackupKeyURI 異地備份密鑰 URI 作為金鑰保存庫無法跨區域,需要在與異地備份相同的區域中使用 cmk 字串
geoBackupUserAssignedIdentityId 異地備份使用者身分識別資源標識碼作為身分識別無法跨區域,需要在與異地備份相同的區域中的身分識別 字串
primaryKeyURI 主鍵 URI 字串
primaryUserAssignedIdentityId 主要使用者身分識別資源標識碼 字串
類型 密鑰類型:啟用 cmk 的 AzureKeyVault、適用於停用 cmk 的 SystemManaged。 'AzureKeyVault'
'SystemManaged'

HighAvailability

名字 描述 價值
模式 伺服器的高可用性模式。 'Disabled'
'SameZone'
'ZoneRedundant'
standbyAvailabilityZone 待命伺服器的可用性區域。 字串

ImportSourceProperties

名字 描述 價值
dataDirPath 記憶體中資料目錄的相對路徑。 字串
sasToken 用於存取來源記憶體的 Sas 令牌。 SAS 令牌需要讀取和列表許可權。 字串

約束:
敏感性值。 以安全參數的形式傳入。
storageType 匯入來源的儲存類型。 'AzureBlob'
storageUrl 匯入來源記憶體的 URI。 字串

MaintenanceWindow

名字 描述 價值
customWindow 指出是否啟用或停用自定義視窗 字串
dayOfWeek 維護時段的星期數 int
startHour 維護時段的開始時間 int
startMinute 維護時段的開始分鐘 int

網路

名字 描述 價值
delegatedSubnetResourceId 用來為伺服器設定 vnet 的委派子網資源標識碼。 字串
privateDnsZoneResourceId 私人 DNS 區域資源識別碼。 字串
publicNetworkAccess 此伺服器是否允許公用網路存取。 當伺服器具有 VNet 整合時,值為 『Disabled』。 'Disabled'
'Enabled'

存儲

名字 描述 價值
autoGrow 啟用記憶體自動成長。 'Disabled'
'Enabled'
autoIoScaling 啟用 IO 自動調整。 'Disabled'
'Enabled'
iops 伺服器的記憶體 IOPS。 int
logOnDisk 啟用登入磁碟。 'Disabled'
'Enabled'
storageSizeGB 伺服器允許的記憶體大小上限。 int

MySQLServerSku

名字 描述 價值
名字 sku 的名稱,例如Standard_D32s_v3。 字串 (必要)
特定 SKU 的層級,例如 GeneralPurpose。 「高載」
'GeneralPurpose'
'MemoryOptimized' (必要)

快速入門範本

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

範本 描述
建立 MySqlFlex 伺服器 & 透過Backup Vault 啟用保護

部署至 Azure
建立 MySQL 彈性伺服器的範本,並透過備份保存庫啟用保護
使用私人端點部署 MySQL 彈性伺服器

部署至 Azure
此範本提供使用私人端點部署適用於 MySQL 的 Azure 資料庫彈性伺服器的方式。
使用 Vnet 整合部署 MySQL 彈性伺服器

部署至 Azure
此範本提供部署適用於 MySQL 彈性伺服器的 Azure 資料庫與 VNet 整合的方式。

Terraform (AzAPI 提供者) 資源定義

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

  • 資源群組

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

資源格式

若要建立 Microsoft.DBforMySQL/flexibleServers 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DBforMySQL/flexibleServers@2023-06-30"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type = "UserAssigned"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      administratorLogin = "string"
      administratorLoginPassword = "string"
      availabilityZone = "string"
      backup = {
        backupRetentionDays = int
        geoRedundantBackup = "string"
      }
      createMode = "string"
      dataEncryption = {
        geoBackupKeyURI = "string"
        geoBackupUserAssignedIdentityId = "string"
        primaryKeyURI = "string"
        primaryUserAssignedIdentityId = "string"
        type = "string"
      }
      highAvailability = {
        mode = "string"
        standbyAvailabilityZone = "string"
      }
      importSourceProperties = {
        dataDirPath = "string"
        sasToken = "string"
        storageType = "AzureBlob"
        storageUrl = "string"
      }
      maintenanceWindow = {
        customWindow = "string"
        dayOfWeek = int
        startHour = int
        startMinute = int
      }
      network = {
        delegatedSubnetResourceId = "string"
        privateDnsZoneResourceId = "string"
        publicNetworkAccess = "string"
      }
      replicationRole = "string"
      restorePointInTime = "string"
      sourceServerResourceId = "string"
      storage = {
        autoGrow = "string"
        autoIoScaling = "string"
        iops = int
        logOnDisk = "string"
        storageSizeGB = int
      }
      version = "string"
    }
    sku = {
      name = "string"
      tier = "string"
    }
  })
}

屬性值

flexibleServers

名字 描述 價值
類型 資源類型 “Microsoft.DBforMySQL/flexibleServers@2023-06-30”
名字 資源名稱 字串 (必要)
位置 資源所在的地理位置 字串 (必要)
parent_id 若要部署至資源群組,請使用該資源群組的標識碼。 字串 (必要)
標籤 資源標籤。 標記名稱和值的字典。
sku 伺服器的 SKU(定價層)。 MySQLServerSku
身份 伺服器的 Cmk 身分識別。 MySQLServerIdentity
性能 伺服器的屬性。 ServerProperties

MySQLServerIdentity

名字 描述 價值
類型 受控服務識別的類型。 “UserAssigned”
identity_ids 使用者指派身分識別的元數據。 使用者身分識別標識碼的陣列。

MySQLServerIdentityUserAssignedIdentities

名字 描述 價值
{自定義屬性}

ServerProperties

名字 描述 價值
administratorLogin 系統管理員的伺服器登入名稱。 只有在建立伺服器時才能指定 (而且是建立的必要專案)。 字串
administratorLoginPassword 系統管理員登入的密碼(建立伺服器所需的密碼)。 字串

約束:
敏感性值。 以安全參數的形式傳入。
availabilityZone 伺服器的可用性區域資訊。 字串
備份 備份伺服器的相關屬性。 備份
createMode 建立新 MySQL 伺服器的模式。 “Default”
“GeoRestore”
“PointInTimeRestore”
“Replica”
dataEncryption CMK 的數據加密。 DataEncryption
highAvailability 伺服器的高可用性相關屬性。 HighAvailability
importSourceProperties 從記憶體匯入的來源屬性。 ImportSourceProperties
maintenanceWindow 伺服器的維護時間範圍。 MaintenanceWindow
網路 伺服器的網路相關屬性。 網路
replicationRole 複寫角色。 “None”
“Replica”
“Source”
restorePointInTime 還原點建立時間(ISO8601格式),指定要還原的時間。 字串
sourceServerResourceId 來源 MySQL 伺服器識別碼。 字串
存儲 伺服器的記憶體相關屬性。 記憶體
版本 伺服器版本。 "5.7"
"8.0.21"

備份

名字 描述 價值
backupRetentionDays 伺服器的備份保留天數。 int
geoRedundantBackup 是否啟用異地備援備份。 “Disabled”
“Enabled”

DataEncryption

名字 描述 價值
geoBackupKeyURI 異地備份密鑰 URI 作為金鑰保存庫無法跨區域,需要在與異地備份相同的區域中使用 cmk 字串
geoBackupUserAssignedIdentityId 異地備份使用者身分識別資源標識碼作為身分識別無法跨區域,需要在與異地備份相同的區域中的身分識別 字串
primaryKeyURI 主鍵 URI 字串
primaryUserAssignedIdentityId 主要使用者身分識別資源標識碼 字串
類型 密鑰類型:啟用 cmk 的 AzureKeyVault、適用於停用 cmk 的 SystemManaged。 “AzureKeyVault”
“SystemManaged”

HighAvailability

名字 描述 價值
模式 伺服器的高可用性模式。 “Disabled”
“SameZone”
“ZoneRedundant”
standbyAvailabilityZone 待命伺服器的可用性區域。 字串

ImportSourceProperties

名字 描述 價值
dataDirPath 記憶體中資料目錄的相對路徑。 字串
sasToken 用於存取來源記憶體的 Sas 令牌。 SAS 令牌需要讀取和列表許可權。 字串

約束:
敏感性值。 以安全參數的形式傳入。
storageType 匯入來源的儲存類型。 “AzureBlob”
storageUrl 匯入來源記憶體的 URI。 字串

MaintenanceWindow

名字 描述 價值
customWindow 指出是否啟用或停用自定義視窗 字串
dayOfWeek 維護時段的星期數 int
startHour 維護時段的開始時間 int
startMinute 維護時段的開始分鐘 int

網路

名字 描述 價值
delegatedSubnetResourceId 用來為伺服器設定 vnet 的委派子網資源標識碼。 字串
privateDnsZoneResourceId 私人 DNS 區域資源識別碼。 字串
publicNetworkAccess 此伺服器是否允許公用網路存取。 當伺服器具有 VNet 整合時,值為 『Disabled』。 “Disabled”
“Enabled”

存儲

名字 描述 價值
autoGrow 啟用記憶體自動成長。 “Disabled”
“Enabled”
autoIoScaling 啟用 IO 自動調整。 “Disabled”
“Enabled”
iops 伺服器的記憶體 IOPS。 int
logOnDisk 啟用登入磁碟。 “Disabled”
“Enabled”
storageSizeGB 伺服器允許的記憶體大小上限。 int

MySQLServerSku

名字 描述 價值
名字 sku 的名稱,例如Standard_D32s_v3。 字串 (必要)
特定 SKU 的層級,例如 GeneralPurpose。 “高載”
“GeneralPurpose”
“MemoryOptimized” (必要)