Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
- Latest
- 2025-12-01-preview
- 2025-06-01-preview
- 2024-12-30
- 2024-12-01-preview
- 2024-10-01-preview
- 2024-06-01-preview
- 2024-02-01-preview
- 2023-12-30
- 2023-12-01-preview
- 2023-10-01-preview
- 2023-06-30
- 2023-06-01-preview
- 2022-09-30-preview
- 2022-01-01
- 2021-12-01-preview
- 2021-05-01
- 2021-05-01-preview
- 2020-07-01-preview
Remarks
Use the maintenanceWindow property only when updating an existing flexible server. When creating a new flexible servcer, don't specify values for this property.
Bicep resource definition
The flexibleServers resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Usage Examples
Bicep Samples
A basic example of deploying MySQL Flexible Server.
param location string = 'westeurope'
@description('The administrator login name for the MySQL flexible server')
param administratorLogin string
@secure()
@description('The administrator login password for the MySQL flexible server')
param administratorLoginPassword string
param resourceName string = 'acctest0001'
resource flexibleServer 'Microsoft.DBforMySQL/flexibleServers@2021-05-01' = {
name: resourceName
location: location
sku: {
name: 'Standard_B1s'
tier: 'Burstable'
}
properties: {
administratorLogin: administratorLogin
administratorLoginPassword: administratorLoginPassword
backup: {
backupRetentionDays: 7
geoRedundantBackup: 'Disabled'
}
createMode: ''
dataEncryption: {
type: 'SystemManaged'
}
highAvailability: {
mode: 'Disabled'
}
network: {}
}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module | Description |
|---|---|
| DB for MySQL Flexible Server | AVM Resource Module for DB for MySQL Flexible Server |
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
| Bicep File | Description |
|---|---|
| Create MySQL Flexible Server & enable protection via Backup Vault | Template that creates a MySQL Flexible Server and enables protection via Backup Vault |
| Deploy MySQL Flexible Server with Entra Authentication | This template provides a way to deploy a Azure database for MySQL Flexible Server with Entra Authentication. |
| Deploy MySQL Flexible Server with Private Endpoint | This template provides a way to deploy a Azure Database for MySQL Flexible Server with Private Endpoint. |
| Deploy MySQL Flexible Server with Vnet Integration | This template provides a way to deploy a Azure database for MySQL Flexible Server with VNet Integration. |
Resource format
To create a Microsoft.DBForMySql/flexibleServers resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.DBForMySql/flexibleServers@2020-07-01-preview' = {
identity: {
type: 'SystemAssigned'
}
location: 'string'
name: 'string'
properties: {
administratorLogin: 'string'
administratorLoginPassword: 'string'
availabilityZone: 'string'
createMode: 'string'
delegatedSubnetArguments: {
subnetArmResourceId: 'string'
}
haEnabled: 'string'
infrastructureEncryption: 'string'
maintenanceWindow: {
customWindow: 'string'
dayOfWeek: int
startHour: int
startMinute: int
}
privateDnsZoneArguments: {
privateDnsZoneArmResourceId: 'string'
}
replicationRole: 'string'
restorePointInTime: 'string'
sourceServerId: 'string'
sslEnforcement: 'string'
storageProfile: {
backupRetentionDays: int
storageAutogrow: 'string'
storageIops: int
storageMB: int
}
tags: {
{customized property}: 'string'
}
version: 'string'
}
sku: {
name: 'string'
tier: 'string'
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.DBForMySql/flexibleServers
| Name | Description | Value |
|---|---|---|
| identity | The Azure Active Directory identity of the server. | Identity |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string (required) |
| properties | Properties of the server. | ServerProperties |
| sku | The SKU (pricing tier) of the server. | Sku |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
DelegatedSubnetArguments
| Name | Description | Value |
|---|---|---|
| subnetArmResourceId | delegated subnet arm resource id. | string |
Identity
| Name | Description | Value |
|---|---|---|
| type | The identity type. | 'SystemAssigned' |
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| customWindow | indicates whether custom window is enabled or disabled | string |
| dayOfWeek | day of week for maintenance window | int |
| startHour | start hour for maintenance window | int |
| startMinute | start minute for maintenance window | int |
PrivateDnsZoneArguments
| Name | Description | Value |
|---|---|---|
| privateDnsZoneArmResourceId | private dns zone arm resource id. | string |
ServerProperties
| Name | Description | Value |
|---|---|---|
| administratorLogin | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). | string |
| administratorLoginPassword | The password of the administrator login (required for server creation). | string Constraints: Sensitive value. Pass in as a secure parameter. |
| availabilityZone | availability Zone information of the server. | string |
| createMode | The mode to create a new MySQL server. | 'Default' 'PointInTimeRestore' 'Replica' |
| delegatedSubnetArguments | Delegated subnet arguments. | DelegatedSubnetArguments |
| haEnabled | Enable HA or not for a server. | 'Disabled' 'Enabled' |
| infrastructureEncryption | Status showing whether the server enabled infrastructure encryption. | 'Disabled' 'Enabled' |
| maintenanceWindow | Maintenance window of a server. | MaintenanceWindow |
| privateDnsZoneArguments | private dns zone arguments. | PrivateDnsZoneArguments |
| replicationRole | The replication role. | string |
| restorePointInTime | Restore point creation time (ISO8601 format), specifying the time to restore from. | string |
| sourceServerId | The source MySQL server id. | string |
| sslEnforcement | Enable ssl enforcement or not when connect to server. | 'Disabled' 'Enabled' |
| storageProfile | Storage profile of a server. | StorageProfile |
| tags | Application-specific metadata in the form of key-value pairs. | ServerPropertiesTags |
| version | Server version. | '5.7' |
ServerPropertiesTags
| Name | Description | Value |
|---|
Sku
| Name | Description | Value |
|---|---|---|
| name | The name of the sku, e.g. Standard_D32s_v3. | string (required) |
| tier | The tier of the particular SKU, e.g. GeneralPurpose. | 'Burstable' 'GeneralPurpose' 'MemoryOptimized' (required) |
StorageProfile
| Name | Description | Value |
|---|---|---|
| backupRetentionDays | Backup retention days for the server. | int |
| storageAutogrow | Enable Storage Auto Grow. | 'Disabled' 'Enabled' |
| storageIops | Storage IOPS for a server. | int |
| storageMB | Max storage allowed for a server. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
ARM template resource definition
The flexibleServers resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands For a list of changed properties in each API version, see change log.
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
| Template | Description |
|---|---|
| Create MySQL Flexible Server & enable protection via Backup Vault |
Template that creates a MySQL Flexible Server and enables protection via Backup Vault |
| Deploy MySQL Flexible Server with Entra Authentication |
This template provides a way to deploy a Azure database for MySQL Flexible Server with Entra Authentication. |
| Deploy MySQL Flexible Server with Private Endpoint |
This template provides a way to deploy a Azure Database for MySQL Flexible Server with Private Endpoint. |
| Deploy MySQL Flexible Server with Vnet Integration |
This template provides a way to deploy a Azure database for MySQL Flexible Server with VNet Integration. |
Resource format
To create a Microsoft.DBForMySql/flexibleServers resource, add the following JSON to your template.
{
"type": "Microsoft.DBForMySql/flexibleServers",
"apiVersion": "2020-07-01-preview",
"name": "string",
"identity": {
"type": "SystemAssigned"
},
"location": "string",
"properties": {
"administratorLogin": "string",
"administratorLoginPassword": "string",
"availabilityZone": "string",
"createMode": "string",
"delegatedSubnetArguments": {
"subnetArmResourceId": "string"
},
"haEnabled": "string",
"infrastructureEncryption": "string",
"maintenanceWindow": {
"customWindow": "string",
"dayOfWeek": "int",
"startHour": "int",
"startMinute": "int"
},
"privateDnsZoneArguments": {
"privateDnsZoneArmResourceId": "string"
},
"replicationRole": "string",
"restorePointInTime": "string",
"sourceServerId": "string",
"sslEnforcement": "string",
"storageProfile": {
"backupRetentionDays": "int",
"storageAutogrow": "string",
"storageIops": "int",
"storageMB": "int"
},
"tags": {
"{customized property}": "string"
},
"version": "string"
},
"sku": {
"name": "string",
"tier": "string"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.DBForMySql/flexibleServers
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2020-07-01-preview' |
| identity | The Azure Active Directory identity of the server. | Identity |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string (required) |
| properties | Properties of the server. | ServerProperties |
| sku | The SKU (pricing tier) of the server. | Sku |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| type | The resource type | 'Microsoft.DBForMySql/flexibleServers' |
DelegatedSubnetArguments
| Name | Description | Value |
|---|---|---|
| subnetArmResourceId | delegated subnet arm resource id. | string |
Identity
| Name | Description | Value |
|---|---|---|
| type | The identity type. | 'SystemAssigned' |
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| customWindow | indicates whether custom window is enabled or disabled | string |
| dayOfWeek | day of week for maintenance window | int |
| startHour | start hour for maintenance window | int |
| startMinute | start minute for maintenance window | int |
PrivateDnsZoneArguments
| Name | Description | Value |
|---|---|---|
| privateDnsZoneArmResourceId | private dns zone arm resource id. | string |
ServerProperties
| Name | Description | Value |
|---|---|---|
| administratorLogin | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). | string |
| administratorLoginPassword | The password of the administrator login (required for server creation). | string Constraints: Sensitive value. Pass in as a secure parameter. |
| availabilityZone | availability Zone information of the server. | string |
| createMode | The mode to create a new MySQL server. | 'Default' 'PointInTimeRestore' 'Replica' |
| delegatedSubnetArguments | Delegated subnet arguments. | DelegatedSubnetArguments |
| haEnabled | Enable HA or not for a server. | 'Disabled' 'Enabled' |
| infrastructureEncryption | Status showing whether the server enabled infrastructure encryption. | 'Disabled' 'Enabled' |
| maintenanceWindow | Maintenance window of a server. | MaintenanceWindow |
| privateDnsZoneArguments | private dns zone arguments. | PrivateDnsZoneArguments |
| replicationRole | The replication role. | string |
| restorePointInTime | Restore point creation time (ISO8601 format), specifying the time to restore from. | string |
| sourceServerId | The source MySQL server id. | string |
| sslEnforcement | Enable ssl enforcement or not when connect to server. | 'Disabled' 'Enabled' |
| storageProfile | Storage profile of a server. | StorageProfile |
| tags | Application-specific metadata in the form of key-value pairs. | ServerPropertiesTags |
| version | Server version. | '5.7' |
ServerPropertiesTags
| Name | Description | Value |
|---|
Sku
| Name | Description | Value |
|---|---|---|
| name | The name of the sku, e.g. Standard_D32s_v3. | string (required) |
| tier | The tier of the particular SKU, e.g. GeneralPurpose. | 'Burstable' 'GeneralPurpose' 'MemoryOptimized' (required) |
StorageProfile
| Name | Description | Value |
|---|---|---|
| backupRetentionDays | Backup retention days for the server. | int |
| storageAutogrow | Enable Storage Auto Grow. | 'Disabled' 'Enabled' |
| storageIops | Storage IOPS for a server. | int |
| storageMB | Max storage allowed for a server. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
Terraform (AzAPI provider) resource definition
The flexibleServers resource type can be deployed with operations that target:
- Resource groups For a list of changed properties in each API version, see change log.
Usage Examples
Terraform Samples
A basic example of deploying MySQL Flexible Server.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
variable "administrator_login" {
type = string
description = "The administrator login name for the MySQL flexible server"
}
variable "administrator_login_password" {
type = string
description = "The administrator login password for the MySQL flexible server"
sensitive = true
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "flexibleServer" {
type = "Microsoft.DBforMySQL/flexibleServers@2021-05-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
administratorLogin = var.administrator_login
administratorLoginPassword = var.administrator_login_password
backup = {
backupRetentionDays = 7
geoRedundantBackup = "Disabled"
}
createMode = ""
dataEncryption = {
type = "SystemManaged"
}
highAvailability = {
mode = "Disabled"
}
network = {
}
}
sku = {
name = "Standard_B1s"
tier = "Burstable"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module | Description |
|---|---|
| DB for MySQL Flexible Server | AVM Resource Module for DB for MySQL Flexible Server |
Resource format
To create a Microsoft.DBForMySql/flexibleServers resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DBForMySql/flexibleServers@2020-07-01-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
administratorLogin = "string"
administratorLoginPassword = "string"
availabilityZone = "string"
createMode = "string"
delegatedSubnetArguments = {
subnetArmResourceId = "string"
}
haEnabled = "string"
infrastructureEncryption = "string"
maintenanceWindow = {
customWindow = "string"
dayOfWeek = int
startHour = int
startMinute = int
}
privateDnsZoneArguments = {
privateDnsZoneArmResourceId = "string"
}
replicationRole = "string"
restorePointInTime = "string"
sourceServerId = "string"
sslEnforcement = "string"
storageProfile = {
backupRetentionDays = int
storageAutogrow = "string"
storageIops = int
storageMB = int
}
tags = {
{customized property} = "string"
}
version = "string"
}
sku = {
name = "string"
tier = "string"
}
}
}
Property Values
Microsoft.DBForMySql/flexibleServers
| Name | Description | Value |
|---|---|---|
| identity | The Azure Active Directory identity of the server. | Identity |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string (required) |
| properties | Properties of the server. | ServerProperties |
| sku | The SKU (pricing tier) of the server. | Sku |
| tags | Resource tags | Dictionary of tag names and values. |
| type | The resource type | "Microsoft.DBForMySql/flexibleServers@2020-07-01-preview" |
DelegatedSubnetArguments
| Name | Description | Value |
|---|---|---|
| subnetArmResourceId | delegated subnet arm resource id. | string |
Identity
| Name | Description | Value |
|---|---|---|
| type | The identity type. | 'SystemAssigned' |
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| customWindow | indicates whether custom window is enabled or disabled | string |
| dayOfWeek | day of week for maintenance window | int |
| startHour | start hour for maintenance window | int |
| startMinute | start minute for maintenance window | int |
PrivateDnsZoneArguments
| Name | Description | Value |
|---|---|---|
| privateDnsZoneArmResourceId | private dns zone arm resource id. | string |
ServerProperties
| Name | Description | Value |
|---|---|---|
| administratorLogin | The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). | string |
| administratorLoginPassword | The password of the administrator login (required for server creation). | string Constraints: Sensitive value. Pass in as a secure parameter. |
| availabilityZone | availability Zone information of the server. | string |
| createMode | The mode to create a new MySQL server. | 'Default' 'PointInTimeRestore' 'Replica' |
| delegatedSubnetArguments | Delegated subnet arguments. | DelegatedSubnetArguments |
| haEnabled | Enable HA or not for a server. | 'Disabled' 'Enabled' |
| infrastructureEncryption | Status showing whether the server enabled infrastructure encryption. | 'Disabled' 'Enabled' |
| maintenanceWindow | Maintenance window of a server. | MaintenanceWindow |
| privateDnsZoneArguments | private dns zone arguments. | PrivateDnsZoneArguments |
| replicationRole | The replication role. | string |
| restorePointInTime | Restore point creation time (ISO8601 format), specifying the time to restore from. | string |
| sourceServerId | The source MySQL server id. | string |
| sslEnforcement | Enable ssl enforcement or not when connect to server. | 'Disabled' 'Enabled' |
| storageProfile | Storage profile of a server. | StorageProfile |
| tags | Application-specific metadata in the form of key-value pairs. | ServerPropertiesTags |
| version | Server version. | '5.7' |
ServerPropertiesTags
| Name | Description | Value |
|---|
Sku
| Name | Description | Value |
|---|---|---|
| name | The name of the sku, e.g. Standard_D32s_v3. | string (required) |
| tier | The tier of the particular SKU, e.g. GeneralPurpose. | 'Burstable' 'GeneralPurpose' 'MemoryOptimized' (required) |
StorageProfile
| Name | Description | Value |
|---|---|---|
| backupRetentionDays | Backup retention days for the server. | int |
| storageAutogrow | Enable Storage Auto Grow. | 'Disabled' 'Enabled' |
| storageIops | Storage IOPS for a server. | int |
| storageMB | Max storage allowed for a server. | int |
TrackedResourceTags
| Name | Description | Value |
|---|