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.
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:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DBforMySQL/flexibleServers resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.DBforMySQL/flexibleServers@2025-06-01-preview' = {
scope: resourceSymbolicName or scope
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
location: 'string'
name: 'string'
properties: {
administratorLogin: 'string'
administratorLoginPassword: 'string'
availabilityZone: 'string'
backup: {
backupIntervalHours: int
backupRetentionDays: int
geoRedundantBackup: 'string'
}
createMode: 'string'
databasePort: int
dataEncryption: {
geoBackupKeyURI: 'string'
geoBackupUserAssignedIdentityId: 'string'
primaryKeyURI: 'string'
primaryUserAssignedIdentityId: 'string'
type: 'string'
}
highAvailability: {
mode: 'string'
replicationMode: 'string'
standbyAvailabilityZone: 'string'
}
importSourceProperties: {
dataDirPath: 'string'
sasToken: 'string'
storageType: 'string'
storageUrl: 'string'
}
lowerCaseTableNames: int
maintenancePolicy: {
patchStrategy: 'string'
}
maintenanceWindow: {
batchOfMaintenance: 'string'
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'
storageRedundancy: 'string'
storageSizeGB: int
}
version: 'string'
}
sku: {
name: 'string'
tier: 'string'
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.DBforMySQL/flexibleServers
| Name | Description | Value |
|---|---|---|
| identity | The cmk identity for the server. | MySQLServerIdentity |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string Constraints: Min length = 1 Max length = 63 Pattern = ^[a-z0-9][-a-z0-9]*(?<!-)$ (required) |
| properties | Properties of the server. | ServerProperties |
| scope | Use when creating a resource at a scope that is different than the deployment scope. | Set this property to the symbolic name of a resource to apply the extension resource. |
| sku | The SKU (pricing tier) of the server. | MySQLServerSku |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
Backup
| Name | Description | Value |
|---|---|---|
| backupIntervalHours | Backup interval hours for the server. | int |
| backupRetentionDays | Backup retention days for the server. | int |
| geoRedundantBackup | Whether or not geo redundant backup is enabled. | 'Disabled' 'Enabled' |
DataEncryption
| Name | Description | Value |
|---|---|---|
| geoBackupKeyURI | Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup | string |
| geoBackupUserAssignedIdentityId | Geo backup user identity resource id as identity can't cross region, need identity in same region as geo backup | string |
| primaryKeyURI | Primary key uri | string |
| primaryUserAssignedIdentityId | Primary user identity resource id | string |
| type | The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. | 'AzureKeyVault' 'SystemManaged' |
HighAvailability
| Name | Description | Value |
|---|---|---|
| mode | High availability mode for a server. | 'Disabled' 'SameZone' 'ZoneRedundant' |
| replicationMode | HA Replication mode for a server. | 'BinaryLog' 'RedoLog' |
| standbyAvailabilityZone | Availability zone of the standby server. | string |
ImportSourceProperties
| Name | Description | Value |
|---|---|---|
| dataDirPath | Relative path of data directory in storage. | string |
| sasToken | Sas token for accessing source storage. Read and list permissions are required for sas token. | string Constraints: Sensitive value. Pass in as a secure parameter. |
| storageType | Storage type of import source. | 'AzureBlob' |
| storageUrl | Uri of the import source storage. | string |
MaintenancePolicy
| Name | Description | Value |
|---|---|---|
| patchStrategy | The patch strategy of this server | 'Regular' 'VirtualCanary' |
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| batchOfMaintenance | The batch of maintenance when enabled the custom managed maintenance window of a server. | 'Batch1' 'Batch2' 'Default' |
| 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 |
MySQLServerIdentity
| Name | Description | Value |
|---|---|---|
| type | Type of managed service identity. | 'UserAssigned' |
| userAssignedIdentities | Metadata of user assigned identity. | MySQLServerIdentityUserAssignedIdentities |
MySQLServerIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
MySQLServerSku
| 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) |
Network
| Name | Description | Value |
|---|---|---|
| delegatedSubnetResourceId | Delegated subnet resource id used to setup vnet for a server. | string |
| privateDnsZoneResourceId | Private DNS zone resource id. | string |
| publicNetworkAccess | Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet integration. | 'Disabled' 'Enabled' |
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 |
| backup | Backup related properties of a server. | Backup |
| createMode | The mode to create a new MySQL server. | 'Default' 'GeoRestore' 'PointInTimeRestore' 'Replica' |
| databasePort | The server database port. Can only be specified when the server is being created. | int |
| dataEncryption | The Data Encryption for CMK. | DataEncryption |
| highAvailability | High availability related properties of a server. | HighAvailability |
| importSourceProperties | Source properties for import from storage. | ImportSourceProperties |
| lowerCaseTableNames | The mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2. | int |
| maintenancePolicy | Maintenance policy of a server. | MaintenancePolicy |
| maintenanceWindow | Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately. | MaintenanceWindow |
| network | Network related properties of a server. | Network |
| replicationRole | The replication role. | 'None' 'Replica' 'Source' |
| restorePointInTime | Restore point creation time (ISO8601 format), specifying the time to restore from. | string |
| sourceServerResourceId | The source MySQL server id. | string |
| storage | Storage related properties of a server. | Storage |
| version | Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7 | '5.7' '8.0.21' '8.4' |
Storage
| Name | Description | Value |
|---|---|---|
| autoGrow | Enable Storage Auto Grow or not. | 'Disabled' 'Enabled' |
| autoIoScaling | Enable IO Auto Scaling or not. | 'Disabled' 'Enabled' |
| iops | Storage IOPS for a server. | int |
| logOnDisk | Enable Log On Disk or not. | 'Disabled' 'Enabled' |
| storageRedundancy | The redundant type of the server storage. The parameter is used for server creation. | 'LocalRedundancy' 'ZoneRedundancy' |
| storageSizeGB | Max storage size allowed for a server. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
UserAssignedIdentity
| Name | Description | Value |
|---|
Usage Examples
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. |
ARM template resource definition
The flexibleServers resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DBforMySQL/flexibleServers resource, add the following JSON to your template.
{
"type": "Microsoft.DBforMySQL/flexibleServers",
"apiVersion": "2025-06-01-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"location": "string",
"properties": {
"administratorLogin": "string",
"administratorLoginPassword": "string",
"availabilityZone": "string",
"backup": {
"backupIntervalHours": "int",
"backupRetentionDays": "int",
"geoRedundantBackup": "string"
},
"createMode": "string",
"databasePort": "int",
"dataEncryption": {
"geoBackupKeyURI": "string",
"geoBackupUserAssignedIdentityId": "string",
"primaryKeyURI": "string",
"primaryUserAssignedIdentityId": "string",
"type": "string"
},
"highAvailability": {
"mode": "string",
"replicationMode": "string",
"standbyAvailabilityZone": "string"
},
"importSourceProperties": {
"dataDirPath": "string",
"sasToken": "string",
"storageType": "string",
"storageUrl": "string"
},
"lowerCaseTableNames": "int",
"maintenancePolicy": {
"patchStrategy": "string"
},
"maintenanceWindow": {
"batchOfMaintenance": "string",
"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",
"storageRedundancy": "string",
"storageSizeGB": "int"
},
"version": "string"
},
"sku": {
"name": "string",
"tier": "string"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.DBforMySQL/flexibleServers
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2025-06-01-preview' |
| identity | The cmk identity for the server. | MySQLServerIdentity |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string Constraints: Min length = 1 Max length = 63 Pattern = ^[a-z0-9][-a-z0-9]*(?<!-)$ (required) |
| properties | Properties of the server. | ServerProperties |
| sku | The SKU (pricing tier) of the server. | MySQLServerSku |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| type | The resource type | 'Microsoft.DBforMySQL/flexibleServers' |
Backup
| Name | Description | Value |
|---|---|---|
| backupIntervalHours | Backup interval hours for the server. | int |
| backupRetentionDays | Backup retention days for the server. | int |
| geoRedundantBackup | Whether or not geo redundant backup is enabled. | 'Disabled' 'Enabled' |
DataEncryption
| Name | Description | Value |
|---|---|---|
| geoBackupKeyURI | Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup | string |
| geoBackupUserAssignedIdentityId | Geo backup user identity resource id as identity can't cross region, need identity in same region as geo backup | string |
| primaryKeyURI | Primary key uri | string |
| primaryUserAssignedIdentityId | Primary user identity resource id | string |
| type | The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. | 'AzureKeyVault' 'SystemManaged' |
HighAvailability
| Name | Description | Value |
|---|---|---|
| mode | High availability mode for a server. | 'Disabled' 'SameZone' 'ZoneRedundant' |
| replicationMode | HA Replication mode for a server. | 'BinaryLog' 'RedoLog' |
| standbyAvailabilityZone | Availability zone of the standby server. | string |
ImportSourceProperties
| Name | Description | Value |
|---|---|---|
| dataDirPath | Relative path of data directory in storage. | string |
| sasToken | Sas token for accessing source storage. Read and list permissions are required for sas token. | string Constraints: Sensitive value. Pass in as a secure parameter. |
| storageType | Storage type of import source. | 'AzureBlob' |
| storageUrl | Uri of the import source storage. | string |
MaintenancePolicy
| Name | Description | Value |
|---|---|---|
| patchStrategy | The patch strategy of this server | 'Regular' 'VirtualCanary' |
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| batchOfMaintenance | The batch of maintenance when enabled the custom managed maintenance window of a server. | 'Batch1' 'Batch2' 'Default' |
| 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 |
MySQLServerIdentity
| Name | Description | Value |
|---|---|---|
| type | Type of managed service identity. | 'UserAssigned' |
| userAssignedIdentities | Metadata of user assigned identity. | MySQLServerIdentityUserAssignedIdentities |
MySQLServerIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
MySQLServerSku
| 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) |
Network
| Name | Description | Value |
|---|---|---|
| delegatedSubnetResourceId | Delegated subnet resource id used to setup vnet for a server. | string |
| privateDnsZoneResourceId | Private DNS zone resource id. | string |
| publicNetworkAccess | Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet integration. | 'Disabled' 'Enabled' |
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 |
| backup | Backup related properties of a server. | Backup |
| createMode | The mode to create a new MySQL server. | 'Default' 'GeoRestore' 'PointInTimeRestore' 'Replica' |
| databasePort | The server database port. Can only be specified when the server is being created. | int |
| dataEncryption | The Data Encryption for CMK. | DataEncryption |
| highAvailability | High availability related properties of a server. | HighAvailability |
| importSourceProperties | Source properties for import from storage. | ImportSourceProperties |
| lowerCaseTableNames | The mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2. | int |
| maintenancePolicy | Maintenance policy of a server. | MaintenancePolicy |
| maintenanceWindow | Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately. | MaintenanceWindow |
| network | Network related properties of a server. | Network |
| replicationRole | The replication role. | 'None' 'Replica' 'Source' |
| restorePointInTime | Restore point creation time (ISO8601 format), specifying the time to restore from. | string |
| sourceServerResourceId | The source MySQL server id. | string |
| storage | Storage related properties of a server. | Storage |
| version | Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7 | '5.7' '8.0.21' '8.4' |
Storage
| Name | Description | Value |
|---|---|---|
| autoGrow | Enable Storage Auto Grow or not. | 'Disabled' 'Enabled' |
| autoIoScaling | Enable IO Auto Scaling or not. | 'Disabled' 'Enabled' |
| iops | Storage IOPS for a server. | int |
| logOnDisk | Enable Log On Disk or not. | 'Disabled' 'Enabled' |
| storageRedundancy | The redundant type of the server storage. The parameter is used for server creation. | 'LocalRedundancy' 'ZoneRedundancy' |
| storageSizeGB | Max storage size allowed for a server. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
UserAssignedIdentity
| Name | Description | Value |
|---|
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. |
Terraform (AzAPI provider) resource definition
The flexibleServers resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DBforMySQL/flexibleServers resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DBforMySQL/flexibleServers@2025-06-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"
backup = {
backupIntervalHours = int
backupRetentionDays = int
geoRedundantBackup = "string"
}
createMode = "string"
databasePort = int
dataEncryption = {
geoBackupKeyURI = "string"
geoBackupUserAssignedIdentityId = "string"
primaryKeyURI = "string"
primaryUserAssignedIdentityId = "string"
type = "string"
}
highAvailability = {
mode = "string"
replicationMode = "string"
standbyAvailabilityZone = "string"
}
importSourceProperties = {
dataDirPath = "string"
sasToken = "string"
storageType = "string"
storageUrl = "string"
}
lowerCaseTableNames = int
maintenancePolicy = {
patchStrategy = "string"
}
maintenanceWindow = {
batchOfMaintenance = "string"
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"
storageRedundancy = "string"
storageSizeGB = int
}
version = "string"
}
sku = {
name = "string"
tier = "string"
}
}
}
Property Values
Microsoft.DBforMySQL/flexibleServers
| Name | Description | Value |
|---|---|---|
| identity | The cmk identity for the server. | MySQLServerIdentity |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string Constraints: Min length = 1 Max length = 63 Pattern = ^[a-z0-9][-a-z0-9]*(?<!-)$ (required) |
| parent_id | The ID of the resource to apply this extension resource to. | string (required) |
| properties | Properties of the server. | ServerProperties |
| sku | The SKU (pricing tier) of the server. | MySQLServerSku |
| tags | Resource tags | Dictionary of tag names and values. |
| type | The resource type | "Microsoft.DBforMySQL/flexibleServers@2025-06-01-preview" |
Backup
| Name | Description | Value |
|---|---|---|
| backupIntervalHours | Backup interval hours for the server. | int |
| backupRetentionDays | Backup retention days for the server. | int |
| geoRedundantBackup | Whether or not geo redundant backup is enabled. | 'Disabled' 'Enabled' |
DataEncryption
| Name | Description | Value |
|---|---|---|
| geoBackupKeyURI | Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup | string |
| geoBackupUserAssignedIdentityId | Geo backup user identity resource id as identity can't cross region, need identity in same region as geo backup | string |
| primaryKeyURI | Primary key uri | string |
| primaryUserAssignedIdentityId | Primary user identity resource id | string |
| type | The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. | 'AzureKeyVault' 'SystemManaged' |
HighAvailability
| Name | Description | Value |
|---|---|---|
| mode | High availability mode for a server. | 'Disabled' 'SameZone' 'ZoneRedundant' |
| replicationMode | HA Replication mode for a server. | 'BinaryLog' 'RedoLog' |
| standbyAvailabilityZone | Availability zone of the standby server. | string |
ImportSourceProperties
| Name | Description | Value |
|---|---|---|
| dataDirPath | Relative path of data directory in storage. | string |
| sasToken | Sas token for accessing source storage. Read and list permissions are required for sas token. | string Constraints: Sensitive value. Pass in as a secure parameter. |
| storageType | Storage type of import source. | 'AzureBlob' |
| storageUrl | Uri of the import source storage. | string |
MaintenancePolicy
| Name | Description | Value |
|---|---|---|
| patchStrategy | The patch strategy of this server | 'Regular' 'VirtualCanary' |
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| batchOfMaintenance | The batch of maintenance when enabled the custom managed maintenance window of a server. | 'Batch1' 'Batch2' 'Default' |
| 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 |
MySQLServerIdentity
| Name | Description | Value |
|---|---|---|
| type | Type of managed service identity. | 'UserAssigned' |
| userAssignedIdentities | Metadata of user assigned identity. | MySQLServerIdentityUserAssignedIdentities |
MySQLServerIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
MySQLServerSku
| 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) |
Network
| Name | Description | Value |
|---|---|---|
| delegatedSubnetResourceId | Delegated subnet resource id used to setup vnet for a server. | string |
| privateDnsZoneResourceId | Private DNS zone resource id. | string |
| publicNetworkAccess | Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet integration. | 'Disabled' 'Enabled' |
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 |
| backup | Backup related properties of a server. | Backup |
| createMode | The mode to create a new MySQL server. | 'Default' 'GeoRestore' 'PointInTimeRestore' 'Replica' |
| databasePort | The server database port. Can only be specified when the server is being created. | int |
| dataEncryption | The Data Encryption for CMK. | DataEncryption |
| highAvailability | High availability related properties of a server. | HighAvailability |
| importSourceProperties | Source properties for import from storage. | ImportSourceProperties |
| lowerCaseTableNames | The mysql parameter lower_case_table_names. Can only be specified when the server is being created. Allowed values 1 or 2. | int |
| maintenancePolicy | Maintenance policy of a server. | MaintenancePolicy |
| maintenanceWindow | Maintenance window of a server. Known issue: cannot be set during server creation or updated with other properties during server update; must be updated separately. | MaintenanceWindow |
| network | Network related properties of a server. | Network |
| replicationRole | The replication role. | 'None' 'Replica' 'Source' |
| restorePointInTime | Restore point creation time (ISO8601 format), specifying the time to restore from. | string |
| sourceServerResourceId | The source MySQL server id. | string |
| storage | Storage related properties of a server. | Storage |
| version | Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7 | '5.7' '8.0.21' '8.4' |
Storage
| Name | Description | Value |
|---|---|---|
| autoGrow | Enable Storage Auto Grow or not. | 'Disabled' 'Enabled' |
| autoIoScaling | Enable IO Auto Scaling or not. | 'Disabled' 'Enabled' |
| iops | Storage IOPS for a server. | int |
| logOnDisk | Enable Log On Disk or not. | 'Disabled' 'Enabled' |
| storageRedundancy | The redundant type of the server storage. The parameter is used for server creation. | 'LocalRedundancy' 'ZoneRedundancy' |
| storageSizeGB | Max storage size allowed for a server. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
UserAssignedIdentity
| Name | Description | Value |
|---|
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 |