Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
83 stars 26 forks source link

MySQL Flexible deployment fails when properties.maintenanceWindow is set #2239

Open hundredacres opened 1 month ago

hundredacres commented 1 month ago

Bicep version

PS /Users/matthewschmitt/GIT/bicep-registry-modules> az bicep version
A new Bicep release is available: v0.29.45. Upgrade now by running "az bicep upgrade".
Bicep CLI version 0.27.1 (4b41cb6d4b)

Describe the bug When passing a maintenanceWindow configuration to Microsoft.DBforMySQL/flexibleServers@2023-12-30, receive an error:

Status Message: The server '*****' does not exist or in unexpected status. (Code:ServerNotExist)

To Reproduce Using the default tests case code below against the AVM module: https://github.com/Azure/bicep-registry-modules/tree/main/avm/res/db-for-my-sql/flexible-server

  for iteration in ['init', 'idem']: {
    scope: resourceGroup
    name: '${uniqueString(deployment().name, enforcedLocation)}-test-${serviceShort}-${iteration}'
    params: {
      name: '${namePrefix}${serviceShort}001'
      location: enforcedLocation
      administratorLogin: 'adminUserName'
      administratorLoginPassword: password
      skuName: 'Standard_D2ds_v4'
      tier: 'GeneralPurpose'
      maintenanceWindow: {
        customWindow: 'Enabled'
        dayOfWeek: 0
        startHour: 0
        startMinute: 0
      }
    }
  }
]

Expected behavior is that a Flexible server is created.

hundredacres commented 1 month ago

Simplified the test

resource flexibleServer 'Microsoft.DBforMySQL/flexibleServers@2023-06-30' = {
  name: 'ksbz20240723'
  location: 'northeurope'
  sku: {
    name: 'Standard_D2ds_v4'
    tier: 'GeneralPurpose'
  }
  properties: {
    administratorLogin: 'adminUserName'
    administratorLoginPassword: 'adminPassword'
    maintenanceWindow: {
      customWindow: 'Enabled'
      dayOfWeek: 0
      startHour: 0
      startMinute: 0
    }
  }
}

Errors

# az deployment group create --resource-group 20240723 --template-file avm/res/db-for-my-sql/flexible-server/matt.bicep
A new Bicep release is available: v0.29.45. Upgrade now by running "az bicep upgrade".
{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/9cbdb3e9-6a72-4952-abc7-ab5d2f9a29bf/resourceGroups/20240723/providers/Microsoft.Resources/deployments/matt","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ServerNotExist","message":"The server 'ksbz20240723' does not exist or in unexpected status."}]}}
AlexanderSehr commented 1 month ago

Related to: https://github.com/Azure/bicep/discussions/10996