Skip to content

Commit b3f7d37

Browse files
authored
update mysql bicep version (#17)
1 parent 97eb1b5 commit b3f7d37

File tree

2 files changed

+17
-32
lines changed

2 files changed

+17
-32
lines changed

Diff for: infra/core/database/mysql/flexibleserver.bicep

+15-30
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
1+
metadata description = 'Creates an Azure Database for MySQL - Flexible Server.'
12
param name string
23
param location string = resourceGroup().location
34
param tags object = {}
45

56
param sku object
67
param storage object
7-
@description('Database administrator login name')
8-
@minLength(1)
9-
param adminName string = 'mySqlAdmin'
8+
param administratorLogin string
109
@secure()
11-
param adminPassword string
10+
param administratorLoginPassword string
11+
param highAvailabilityMode string = 'Disabled'
1212
param databaseNames array = []
1313
param allowAzureIPsFirewall bool = false
1414
param allowAllIPsFirewall bool = false
1515
param allowedSingleIPs array = []
1616

17-
@description('MySQL version')
18-
@allowed([
19-
'5.7'
20-
'8.0.21'
21-
])
22-
param version string = '8.0.21'
23-
24-
@allowed([
25-
'Disabled'
26-
'ZoneRedundant'
27-
'SameZone'
28-
])
29-
param highAvailabilityMode string = 'Disabled'
17+
// MySQL version
18+
param version string
3019

31-
resource mysqlServer 'Microsoft.DBforMySQL/flexibleServers@2021-05-01' = {
20+
resource mysqlServer 'Microsoft.DBforMySQL/flexibleServers@2023-06-30' = {
3221
location: location
3322
tags: tags
3423
name: name
3524
sku: sku
3625
properties: {
3726
version: version
38-
administratorLogin: adminName
39-
administratorLoginPassword: adminPassword
27+
administratorLogin: administratorLogin
28+
administratorLoginPassword: administratorLoginPassword
4029
storage: storage
4130
highAvailability: {
4231
mode: highAvailabilityMode
@@ -45,33 +34,29 @@ resource mysqlServer 'Microsoft.DBforMySQL/flexibleServers@2021-05-01' = {
4534

4635
resource database 'databases' = [for name in databaseNames: {
4736
name: name
48-
properties: {
49-
charset: 'utf8'
50-
collation: 'utf8_general_ci'
51-
}
5237
}]
5338

5439
resource firewall_all 'firewallRules' = if (allowAllIPsFirewall) {
5540
name: 'allow-all-IPs'
5641
properties: {
57-
startIpAddress: '0.0.0.0'
58-
endIpAddress: '255.255.255.255'
42+
startIpAddress: '0.0.0.0'
43+
endIpAddress: '255.255.255.255'
5944
}
6045
}
6146

6247
resource firewall_azure 'firewallRules' = if (allowAzureIPsFirewall) {
6348
name: 'allow-all-azure-internal-IPs'
6449
properties: {
65-
startIpAddress: '0.0.0.0'
66-
endIpAddress: '0.0.0.0'
50+
startIpAddress: '0.0.0.0'
51+
endIpAddress: '0.0.0.0'
6752
}
6853
}
6954

7055
resource firewall_single 'firewallRules' = [for ip in allowedSingleIPs: {
7156
name: 'allow-single-${replace(ip, '.', '')}'
7257
properties: {
73-
startIpAddress: ip
74-
endIpAddress: ip
58+
startIpAddress: ip
59+
endIpAddress: ip
7560
}
7661
}]
7762

Diff for: infra/main.bicep

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ module mysqlServer 'core/database/mysql/flexibleserver.bicep' = {
7878
storageSizeGB: 20
7979
}
8080
version: '8.0.21'
81-
adminName: mysqlAdminUser
82-
adminPassword: mysqlAdminPassword
81+
administratorLogin: mysqlAdminUser
82+
administratorLoginPassword: mysqlAdminPassword
8383
databaseNames: [ mysqlDatabaseName ]
8484
allowAzureIPsFirewall: true
8585
}

0 commit comments

Comments
 (0)