Azure / Azure/azure-rest-api-specs
[BUG] Postgresql Flexible Server API should return an error when updating autoGrow to "Disabled" and logOnDisk to "Enabled" in one request
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/dcd3d4f2375095bcad2b7ed39bb86da01202bfe6/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/FlexibleServers.json#L42
### API Spec version
2023-12-30
### Describe the bug
I noticed that Postgresql FS API doesn't support the following scenario and it indicates that updating autoGrow to Disabled and logOnDisk to Enabled at the same time is not allowed.
Scenario 1:
1. The request payload to create Postgresql FS with "autoGrow=Enabled" and "logOnDisk=Enabled"
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303163714545992/providers/Microsoft.DBforMySQL/flexibleServers/acctest-fs-250303163714545992
{
"identity": {
"type": "None"
},
"location": "northeurope",
"properties": {
"administratorLogin": "adminTerraform",
"administratorLoginPassword": "xxxxx",
"availabilityZone": "1",
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"createMode": "",
"dataEncryption": {
"type": "SystemManaged"
},
"highAvailability": {
"mode": "Disabled"
},
"network": {
"delegatedSubnetResourceId": "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303163714545992/providers/Microsoft.Network/virtualNetworks/acctest-vn-250303163714545992/subnets/acctest-sn-250303163714545992",
"privateDnsZoneResourceId": "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303163714545992/providers/Microsoft.Network/privateDnsZones/acc250303163714545992.mysql.database.azure.com"
},
"storage": {
"autoGrow": "Enabled",
"autoIoScaling": "Disabled",
"iops": 360,
"logOnDisk": "Enabled",
"storageSizeGB": 20
},
"version": "8.0.21"
},
"sku": {
"name": "Standard_E2ds_v4",
"tier": "MemoryOptimized"
},
"tags": {
"ENV": "Test"
}
}
```
2. The request payload to update Postgresql FS with "autoGrow=Disabled" and "logOnDisk=Enabled".
```
PATCH https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303163714545992/providers/Microsoft.DBforMySQL/flexibleServers/acctest-fs-250303163714545992
{
"properties": {
"storage": {
"autoGrow": "Disabled",
"autoIoScaling": "Disabled",
"iops": 400,
"logOnDisk": "Enabled",
"storageSizeGB": 32
}
}
}
```
3. Service API returns error.
```
polling after Update: polling failed: the Azure API returned the following error:
Status: "NotAllowDisableAutoGrowForLogOnDisk"
Code: ""
Message: "It is not supported to disable auto grow for log_on_disk enabled servers."
Activity Id: ""
```
Then I try to the following scenario 2 but service API doesn't return the expected result. This scenario is to update autoGrow to "Disabled" and logOnDisk to "Enabled" in one request. Though service API is updated without error and service API response returns "autoGrow = Enabled". It's unexpected result. I think service API should return error since the error message in above scenario 1 indicates that updating autoGrow to Disabled and logOnDisk to Enabled at the same time is not allowed.
Scenario 2:
1. Create Postgresql FS with "autoGrow=Disabled" and "logOnDisk=Disabled"
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.DBforMySQL/flexibleServers/acctest-fs-250303171309024961
{
"identity": {
"type": "None"
},
"location": "northeurope",
"properties": {
"administratorLogin": "adminTerraform",
"administratorLoginPassword": "QAZwsx123",
"availabilityZone": "1",
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled"
},
"createMode": "",
"dataEncryption": {
"type": "SystemManaged"
},
"highAvailability": {
"mode": "Disabled"
},
"network": {
"delegatedSubnetResourceId": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.Network/virtualNetworks/acctest-vn-250303171309024961/subnets/acctest-sn-250303171309024961",
"privateDnsZoneResourceId": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.Network/privateDnsZones/acc250303171309024961.mysql.database.azure.com"
},
"storage": {
"autoGrow": "Disabled",
"autoIoScaling": "Disabled",
"iops": 360,
"logOnDisk": "Disabled",
"storageSizeGB": 20
},
"version": "8.0.21"
},
"sku": {
"name": "Standard_E2ds_v4",
"tier": "MemoryOptimized"
},
"tags": {
"ENV": "Test"
}
}
```
2. Update Postgresql with "autoGrow = Disabled" and "logOnDisk = Enabled"
```
PATCH https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.DBforMySQL/flexibleServers/acctest-fs-250303171309024961
{
"properties": {
"storage": {
"autoGrow": "Disabled",
"autoIoScaling": "Disabled",
"iops": 400,
"logOnDisk": "Enabled",
"storageSizeGB": 32
}
}
}
```
API response:
```
{
"sku": {
"name": "Standard_E4ds_v4",
"tier": "MemoryOptimized"
},
"systemData": {
"createdAt": "2025-03-03T09:20:52.3918552Z"
},
"properties": {
"administratorLogin": "adminTerraform",
"storage": {
"storageSizeGB": 32,
"iops": 400,
"autoGrow": "Enabled",
"autoIoScaling": "Disabled",
"storageSku": "Premium_LRS",
"logOnDisk": "Enabled"
},
"version": "8.0.21",
"state": "Ready",
"fullyQualifiedDomainName": "acctest-fs-250303171309024961.mysql.database.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Enabled",
"dayOfWeek": 0,
"startHour": 8,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.Network/virtualNetworks/acctest-vn-250303171309024961/subnets/acctest-sn-250303171309024961",
"privateDnsZoneResourceId": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.Network/privateDnsZones/acc250303171309024961.mysql.database.azure.com"
},
"backup": {
"backupRetentionDays": 10,
"backupIntervalHours": 24,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2025-03-03T09:25:32.7960823+00:00"
},
"highAvailability": {
"mode": "Disabled",
"state": "NotEnabled",
"standbyAvailabilityZone": ""
},
"privateEndpointConnections": []
},
"location": "North Europe",
"tags": {
"ENV": "Stage"
},
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mysql-250303171309024961/providers/Microsoft.DBforMySQL/flexibleServers/acctest-fs-250303171309024961",
"name": "acctest-fs-250303171309024961",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
```
### Expected behavior
Postgresql Flexible Server API should return an error when updating autoGrow to "Disabled" and logOnDisk to "Enabled" in one request.
### Actual behavior
Postgresql Flexible Server API is updated without error and service API response returns "autoGrow = Enabled" when updating autoGrow to "Disabled" and logOnDisk to "Enabled" in one request.
### Reproduction Steps
1. Create Resource Group
2. Create Virtual Network
3. Create Subnet
4. Create Private Dns Zone
5. Create Private Dns Zone Virtual Network Link
6. Create Postgresql Flexible Server with "autoGrow=Disabled" and "logOnDisk=Disabled"
7. Update Postgresql FS with "autoGrow=Disabled" and "logOnDisk=Enabled"
### Environment
PROD
Contributor guide
Research direction
Start with the FlexibleServers.json API specification linked at line 42, then compare the documented storage properties with the two PATCH payloads and responses in the report. Reproduce the update sequence if access is available; done means the specification and service behavior agree on whether the combined values are rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, postgresql
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100