共用方式為


Servers - Update

更新現有伺服器。 要求本文可以包含一對多個存在於一般伺服器定義中的屬性。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}?api-version=2023-12-30

URI 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

資源群組的名稱。 名稱不區分大小寫。

serverName
path True

string

伺服器的名稱。

Regex 模式: ^[a-z0-9][-a-z0-9]*(?<!-)$

subscriptionId
path True

string

uuid

目標訂用帳戶的標識碼。 此值必須是 UUID。

api-version
query True

string

用於此作業的 API 版本。

要求本文

名稱 類型 Description
identity.type

ManagedServiceIdentityType

受控服務識別的類型。

identity.userAssignedIdentities

object

使用者指派身分識別的元數據。

properties.administratorLoginPassword

string

系統管理員登入的密碼。

properties.backup

Backup

備份伺服器的相關屬性。

properties.dataEncryption

DataEncryption

CMK 的數據加密。

properties.highAvailability

HighAvailability

伺服器的高可用性相關屬性。

properties.maintenanceWindow

MaintenanceWindow

伺服器的維護期間。

properties.network

Network

伺服器的網路相關屬性

properties.replicationRole

ReplicationRole

伺服器的復寫角色。

properties.storage

Storage

伺服器的記憶體相關屬性。

properties.version

ServerVersion

伺服器版本。

sku

MySQLServerSku

SKU (伺服器) 定價層。

tags

object

索引鍵/值組形式的應用程式特有中繼資料。

回應

名稱 類型 Description
200 OK

Server

確定

202 Accepted

已接受

標題

Location: string

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

類型: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Update a server
Update server customer maintenance window
Update server with byok

Update a server

Sample request

PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver?api-version=2023-12-30

{
  "properties": {
    "storage": {
      "storageSizeGB": 30,
      "iops": 200,
      "autoGrow": "Disabled",
      "autoIoScaling": "Disabled"
    },
    "network": {
      "publicNetworkAccess": "Disabled"
    }
  }
}

Sample response

{
  "sku": {
    "name": "Standard_D2ds_v4",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "administratorLogin": "cloudsa",
    "storage": {
      "storageSizeGB": 30,
      "iops": 200,
      "autoGrow": "Disabled",
      "storageSku": "Premium_LRS",
      "autoIoScaling": "Disabled"
    },
    "version": "5.7",
    "state": "Ready",
    "fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
    "availabilityZone": "3",
    "maintenanceWindow": {
      "customWindow": "Enabled",
      "dayOfWeek": 1,
      "startHour": 1,
      "startMinute": 0
    },
    "replicationRole": "None",
    "replicaCapacity": 10,
    "network": {
      "publicNetworkAccess": "Disabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "backupIntervalHours": 24,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    }
  },
  "location": "Southeast Asia",
  "tags": {
    "num": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
  "name": "mysqltestserver",
  "type": "Microsoft.DBforMySQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2023-12-30
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2023-12-30

Update server customer maintenance window

Sample request

PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver?api-version=2023-12-30

{
  "properties": {
    "maintenanceWindow": {
      "customWindow": "Enabled",
      "dayOfWeek": 1,
      "startHour": 8,
      "startMinute": 0
    }
  }
}

Sample response

{
  "sku": {
    "name": "Standard_D2ds_v4",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "administratorLogin": "cloudsa",
    "storage": {
      "storageSizeGB": 100,
      "iops": 600,
      "autoGrow": "Enabled",
      "storageSku": "Premium_LRS"
    },
    "version": "5.7",
    "state": "Ready",
    "fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
    "availabilityZone": "3",
    "maintenanceWindow": {
      "customWindow": "Enabled",
      "dayOfWeek": 1,
      "startHour": 8,
      "startMinute": 0
    },
    "replicationRole": "None",
    "replicaCapacity": 10,
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "backupIntervalHours": 24,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    }
  },
  "location": "Southeast Asia",
  "tags": {
    "num": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
  "name": "mysqltestserver",
  "type": "Microsoft.DBforMySQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2023-12-30
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2023-12-30

Update server with byok

Sample request

PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver?api-version=2023-12-30

{
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}
    }
  },
  "properties": {
    "dataEncryption": {
      "type": "AzureKeyVault",
      "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
      "primaryKeyURI": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
      "geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity",
      "geoBackupKeyURI": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"
    }
  }
}

Sample response

{
  "sku": {
    "name": "Standard_D2ds_v4",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "administratorLogin": "cloudsa",
    "storage": {
      "storageSizeGB": 100,
      "iops": 600,
      "autoGrow": "Enabled",
      "storageSku": "Premium_LRS"
    },
    "version": "5.7",
    "state": "Ready",
    "fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
    "availabilityZone": "1",
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    },
    "replicationRole": "None",
    "replicaCapacity": 10,
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "backupIntervalHours": 24,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "3"
    }
  },
  "location": "Southeast Asia",
  "tags": {
    "num": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
  "name": "mysqltestserver",
  "type": "Microsoft.DBforMySQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2023-12-30
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2023-12-30

定義

名稱 Description
Backup

伺服器的記憶體配置檔屬性

createdByType

建立資源的身分識別類型。

CreateMode

建立新 MySQL 伺服器的模式。

DataEncryption

Cmk 的日期加密。

DataEncryptionType

密鑰類型:適用於 enable cmk 的 AzureKeyVault、適用於停用 cmk 的 SystemManaged。

EnableStatusEnum

列舉,指出值是否為 'Enabled' 或 'Disabled'

ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

HighAvailability

伺服器的高可用性屬性

HighAvailabilityMode

伺服器的高可用性模式。

HighAvailabilityState

伺服器高可用性的狀態。

ImportSourceProperties

匯入來源相關屬性。

ImportSourceStorageType

匯入來源的儲存類型。

MaintenanceWindow

伺服器的維護期間。

ManagedServiceIdentityType

受控服務識別的類型。

MySQLServerSku

伺服器帳單相關信息屬性。

Network

伺服器的網路相關屬性

PrivateEndpoint

私人端點資源。

PrivateEndpointConnection

私人端點聯機資源。

PrivateEndpointConnectionProvisioningState

目前的布建狀態。

PrivateEndpointServiceConnectionStatus

私人端點連線狀態。

PrivateLinkServiceConnectionState

服務取用者與提供者之間連線狀態的相關信息集合。

ReplicationRole

複寫角色。

Server

表示伺服器。

ServerForUpdate

允許更新伺服器的參數。

ServerSkuTier

特定 SKU 的層,例如 GeneralPurpose。

ServerState

伺服器的狀態。

ServerVersion

伺服器的版本。

Storage

伺服器的記憶體配置檔屬性

systemData

與建立和上次修改資源相關的元數據。

Backup

伺服器的記憶體配置檔屬性

名稱 類型 預設值 Description
backupIntervalHours

integer

伺服器的備份間隔時數。

backupRetentionDays

integer

伺服器的備份保留天數。

earliestRestoreDate

string

最早的還原點建立時間 (ISO8601 格式)

geoRedundantBackup

EnableStatusEnum

Disabled

是否啟用異地備援備份。

createdByType

建立資源的身分識別類型。

名稱 類型 Description
Application

string

Key

string

ManagedIdentity

string

User

string

CreateMode

建立新 MySQL 伺服器的模式。

名稱 類型 Description
Default

string

GeoRestore

string

PointInTimeRestore

string

Replica

string

DataEncryption

Cmk 的日期加密。

名稱 類型 Description
geoBackupKeyURI

string

異地備份密鑰 URI,因為密鑰保存庫無法跨區域,需要在與異地備份相同的區域中使用 Cmk

geoBackupUserAssignedIdentityId

string

異地備份使用者身分識別資源標識符,因為身分識別無法跨區域,需要與異地備份相同的區域中的身分識別

primaryKeyURI

string

主鍵 URI

primaryUserAssignedIdentityId

string

主要使用者身分識別資源標識碼

type

DataEncryptionType

密鑰類型:適用於 enable cmk 的 AzureKeyVault、適用於停用 cmk 的 SystemManaged。

DataEncryptionType

密鑰類型:適用於 enable cmk 的 AzureKeyVault、適用於停用 cmk 的 SystemManaged。

名稱 類型 Description
AzureKeyVault

string

SystemManaged

string

EnableStatusEnum

列舉,指出值是否為 'Enabled' 或 'Disabled'

名稱 類型 Description
Disabled

string

Enabled

string

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細資料。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

HighAvailability

伺服器的高可用性屬性

名稱 類型 Description
mode

HighAvailabilityMode

伺服器的高可用性模式。

standbyAvailabilityZone

string

待命伺服器的可用性區域。

state

HighAvailabilityState

伺服器高可用性的狀態。

HighAvailabilityMode

伺服器的高可用性模式。

名稱 類型 Description
Disabled

string

SameZone

string

ZoneRedundant

string

HighAvailabilityState

伺服器高可用性的狀態。

名稱 類型 Description
CreatingStandby

string

FailingOver

string

Healthy

string

NotEnabled

string

RemovingStandby

string

ImportSourceProperties

匯入來源相關屬性。

名稱 類型 Description
dataDirPath

string

記憶體中資料目錄的相對路徑。

sasToken

string

用來存取來源記憶體的 Sas 令牌。 SAS 令牌需要讀取和列出許可權。

storageType

ImportSourceStorageType

匯入來源的儲存類型。

storageUrl

string

匯入來源記憶體的 URI。

ImportSourceStorageType

匯入來源的儲存類型。

名稱 類型 Description
AzureBlob

string

MaintenanceWindow

伺服器的維護期間。

名稱 類型 Description
customWindow

string

指出是否啟用或停用自定義視窗

dayOfWeek

integer

維護時段的星期數

startHour

integer

維護時段的開始時間

startMinute

integer

維護時段的開始分鐘

ManagedServiceIdentityType

受控服務識別的類型。

名稱 類型 Description
UserAssigned

string

MySQLServerSku

伺服器帳單相關信息屬性。

名稱 類型 Description
name

string

sku 的名稱,例如Standard_D32s_v3。

tier

ServerSkuTier

特定 SKU 的層,例如 GeneralPurpose。

Network

伺服器的網路相關屬性

名稱 類型 Description
delegatedSubnetResourceId

string

用來設定伺服器的 vnet 的委派子網資源標識碼。

privateDnsZoneResourceId

string

私用 DNS 區域資源標識碼。

publicNetworkAccess

EnableStatusEnum

是否允許此伺服器的公用網路存取。 當伺服器具有 VNet 整合時,值為 『Disabled』。

PrivateEndpoint

私人端點資源。

名稱 類型 Description
id

string

私人端點的ARM標識碼。

PrivateEndpointConnection

私人端點聯機資源。

名稱 類型 Description
id

string

資源的完整資源識別碼。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

資源的名稱

properties.groupIds

string[]

私人端點資源的群組標識碼。

properties.privateEndpoint

PrivateEndpoint

私人端點資源。

properties.privateLinkServiceConnectionState

PrivateLinkServiceConnectionState

服務取用者與提供者之間連線狀態的相關信息集合。

properties.provisioningState

PrivateEndpointConnectionProvisioningState

私人端點聯機資源的布建狀態。

systemData

systemData

Azure Resource Manager 包含 createdBy 和 modifiedBy 資訊的中繼資料。

type

string

資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”

PrivateEndpointConnectionProvisioningState

目前的布建狀態。

名稱 類型 Description
Creating

string

Deleting

string

Failed

string

Succeeded

string

PrivateEndpointServiceConnectionStatus

私人端點連線狀態。

名稱 類型 Description
Approved

string

Pending

string

Rejected

string

PrivateLinkServiceConnectionState

服務取用者與提供者之間連線狀態的相關信息集合。

名稱 類型 Description
actionsRequired

string

訊息,指出服務提供者上的變更是否需要在取用者上進行任何更新。

description

string

連接核准/拒絕的原因。

status

PrivateEndpointServiceConnectionStatus

指出服務擁有者是否已核准/拒絕/移除連線。

ReplicationRole

複寫角色。

名稱 類型 Description
None

string

Replica

string

Source

string

Server

表示伺服器。

名稱 類型 Description
id

string

資源的完整資源識別碼。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

identity.principalId

string

KeyVault 中的 ObjectId

identity.tenantId

string

KeyVault 中的 TenantId

identity.type

ManagedServiceIdentityType

受控服務識別的類型。

identity.userAssignedIdentities

object

使用者指派身分識別的元數據。

location

string

資源所在的地理位置

name

string

資源的名稱

properties.administratorLogin

string

伺服器的系統管理員登入名稱。 只有在建立伺服器 (且建立) 時才能指定。

properties.administratorLoginPassword

string

伺服器建立) 所需的系統管理員登入密碼 (。

properties.availabilityZone

string

伺服器的可用性區域資訊。

properties.backup

Backup

備份伺服器的相關屬性。

properties.createMode

CreateMode

建立新 MySQL 伺服器的模式。

properties.dataEncryption

DataEncryption

CMK 的數據加密。

properties.fullyQualifiedDomainName

string

伺服器的完整功能變數名稱。

properties.highAvailability

HighAvailability

伺服器的高可用性相關屬性。

properties.importSourceProperties

ImportSourceProperties

從記憶體匯入的來源屬性。

properties.maintenanceWindow

MaintenanceWindow

伺服器的維護期間。

properties.network

Network

伺服器的網路相關屬性。

properties.privateEndpointConnections

PrivateEndpointConnection[]

伺服器的 PrivateEndpointConnections 相關屬性。

properties.replicaCapacity

integer

主伺服器可以擁有的最大複本數目。

properties.replicationRole

ReplicationRole

複寫角色。

properties.restorePointInTime

string

還原點建立時間 (ISO8601 格式) ,指定要從中還原的時間。

properties.sourceServerResourceId

string

來源 MySQL 伺服器識別碼。

properties.state

ServerState

伺服器的狀態。

properties.storage

Storage

伺服器的記憶體相關屬性。

properties.version

ServerVersion

伺服器版本。

sku

MySQLServerSku

伺服器的 SKU (定價層) 。

systemData

systemData

Azure Resource Manager 包含 createdBy 和 modifiedBy 資訊的中繼資料。

tags

object

資源標籤。

type

string

資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”

ServerForUpdate

允許更新伺服器的參數。

名稱 類型 Description
identity.principalId

string

KeyVault 中的 ObjectId

identity.tenantId

string

KeyVault 中的 TenantId

identity.type

ManagedServiceIdentityType

受控服務識別的類型。

identity.userAssignedIdentities

object

使用者指派身分識別的元數據。

properties.administratorLoginPassword

string

系統管理員登入的密碼。

properties.backup

Backup

備份伺服器的相關屬性。

properties.dataEncryption

DataEncryption

CMK 的數據加密。

properties.highAvailability

HighAvailability

伺服器的高可用性相關屬性。

properties.maintenanceWindow

MaintenanceWindow

伺服器的維護期間。

properties.network

Network

伺服器的網路相關屬性

properties.replicationRole

ReplicationRole

伺服器的復寫角色。

properties.storage

Storage

伺服器的記憶體相關屬性。

properties.version

ServerVersion

伺服器版本。

sku

MySQLServerSku

伺服器的 SKU (定價層) 。

tags

object

索引鍵/值組形式的應用程式特有中繼資料。

ServerSkuTier

特定 SKU 的層,例如 GeneralPurpose。

名稱 類型 Description
Burstable

string

GeneralPurpose

string

MemoryOptimized

string

ServerState

伺服器的狀態。

名稱 類型 Description
Disabled

string

Dropping

string

Ready

string

Starting

string

Stopped

string

Stopping

string

Updating

string

ServerVersion

伺服器的版本。

名稱 類型 Description
5.7

string

8.0.21

string

Storage

伺服器的記憶體配置檔屬性

名稱 類型 預設值 Description
autoGrow

EnableStatusEnum

Disabled

啟用記憶體自動成長。

autoIoScaling

EnableStatusEnum

Enabled

啟用 IO 自動調整。

iops

integer

伺服器的記憶體 IOPS。

logOnDisk

EnableStatusEnum

Disabled

啟用登入磁碟。

storageSizeGB

integer

伺服器允許的記憶體大小上限。

storageSku

string

伺服器記憶體的 SKU 名稱。

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string

資源建立的時間戳 (UTC) 。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。