---
title: "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}"
method: PATCH
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}"
tags: ["Servers"]
---

# PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}

`PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}`

Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.

## Path parameters

- `serverName` string, required

## Parameters

- `../../../../../../common-types/resource-management/v5/types.json#/components/parameters/ApiVersionParameter` — unresolved $ref
- `../../../../../../common-types/resource-management/v5/types.json#/components/parameters/SubscriptionIdParameter` — unresolved $ref
- `../../../../../../common-types/resource-management/v5/types.json#/components/parameters/ResourceGroupNameParameter` — unresolved $ref

## Request body

- ServerForUpdate — Parameters allowed to update for a server.
  - `identity` MySQLServerIdentity — Properties to configure Identity for Bring your Own Keys
    - `principalId` string — ObjectId from the KeyVault
    - `tenantId` string — TenantId from the KeyVault
    - `type` 'UserAssigned' — Type of managed service identity.
    - `userAssignedIdentities` object — Metadata of user assigned identity.
  - `sku` MySQLServerSku — Billing information related properties of a server.
    - `name` string, required — The name of the sku, e.g. Standard_D32s_v3.
    - `tier` 'Burstable' | 'GeneralPurpose' | 'MemoryOptimized', required — The tier of the particular SKU, e.g. GeneralPurpose.
  - `properties` ServerPropertiesForUpdate — The properties that can be updated for a server.
    - `administratorLoginPassword` string, password — The password of the administrator login.
    - `version` '5.7' | '8.0.21' — The major version of a server. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7
    - `storage` Storage — Storage Profile properties of a server
      - `storageSizeGB` integer — Max storage size allowed for a server.
      - `iops` integer — Storage IOPS for a server.
      - `autoGrow` 'Enabled' | 'Disabled' — Enable Storage Auto Grow or not.
      - `logOnDisk` 'Enabled' | 'Disabled' — Enable Log On Disk or not.
      - `storageSku` string — The sku name of the server storage.
      - `autoIoScaling` 'Enabled' | 'Disabled' — Enable IO Auto Scaling or not.
      - `storageRedundancy` 'LocalRedundancy' | 'ZoneRedundancy' — The redundant type of the server storage. The parameter is used for server creation.
    - `backup` Backup — Storage Profile properties of a server
      - `backupRetentionDays` integer — Backup retention days for the server.
      - `backupIntervalHours` integer — Backup interval hours for the server.
      - `geoRedundantBackup` 'Enabled' | 'Disabled' — Whether or not geo redundant backup is enabled.
      - `earliestRestoreDate` string, date-time — Earliest restore point creation time (ISO8601 format)
    - `highAvailability` HighAvailability — High availability properties of a server
      - `mode` 'Disabled' | 'ZoneRedundant' | 'SameZone' — High availability mode for a server.
      - `state` 'NotEnabled' | 'CreatingStandby' | 'Healthy' | 'FailingOver' | 'RemovingStandby' — The state of server high availability.
      - `standbyAvailabilityZone` string — Availability zone of the standby server.
    - `maintenancePolicy` MaintenancePolicy — Maintenance policy of a server.
      - `patchStrategy` 'Regular' | 'VirtualCanary' — Enum to indicate the patch strategy of a server
    - `maintenanceWindow` MaintenanceWindow — Maintenance window of a server.
      - `customWindow` string — indicates whether custom window is enabled or disabled
      - `startHour` integer — start hour for maintenance window
      - `startMinute` integer — start minute for maintenance window
      - `dayOfWeek` integer — day of week for maintenance window
      - `batchOfMaintenance` 'Default' | 'Batch1' | 'Batch2' — The batch of maintenance when enabled the custom managed maintenance window of a server.
    - `replicationRole` 'None' | 'Source' | 'Replica' — The replication role.
    - `dataEncryption` DataEncryption — The date encryption for cmk.
      - `primaryUserAssignedIdentityId` string — Primary user identity resource id
      - `primaryKeyURI` string — Primary key uri
      - `geoBackupUserAssignedIdentityId` string — Geo backup user identity resource id as identity can't cross region, need identity in same region as geo backup
      - `geoBackupKeyURI` string — Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup
      - `type` 'AzureKeyVault' | 'SystemManaged' — The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk.
    - `network` Network — Network related properties of a server
      - `publicNetworkAccess` 'Enabled' | 'Disabled' — Enum to indicate whether value is 'Enabled' or 'Disabled'
      - `delegatedSubnetResourceId` string — Delegated subnet resource id used to setup vnet for a server.
      - `privateDnsZoneResourceId` string — Private DNS zone resource id.
  - `tags` object — Application-specific metadata in the form of key-value pairs.

## Response `200`

Azure operation completed successfully.

- Server — unresolved $ref

## Other responses

- `202` — Resource update request accepted.
- `default` — An unexpected error response.

---

[API](https://skmtc.dev/azure/apis/mysqlmanagementclient.md) · [All operations](https://skmtc.dev/azure/apis/mysqlmanagementclient/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/mysqlmanagementclient/revisions/13390d0300c9/schema)
