Azure Database for PostgreSQL flexible server deployment fails with databaseName param error

Viewed 57

I'm trying to deploy PostgreSQL managed service with bicep and in most cases get an error:

"code": "InvalidParameterValue",
"message": "Invalid value given for parameter databaseName. Specify a valid parameter value."
 

I've tried various names for the DB, even in last version of the script I add random suffix to made it unique. Anyway it finishes with error, but looks like service is working. Another unexplainable thing is that sometimes script finishes without error... It's part of my IaC scenario, i need to be able to rerun it many times...

bicep code:

param location string
@secure()
param sqlserverLoginPassword string
param rand string = uniqueString(resourceGroup().id) // Generate unique String
param sqlserverName string = toLower('invivopsql-${rand}')
param sqlserverAdminName string = 'invivoadmin'
param psqlDatabaseName string = 'postgres'

resource flexibleServer 'Microsoft.DBforPostgreSQL/flexibleServers@2021-06-01' = {
  name: sqlserverName
  location: location
  sku: {
    name: 'Standard_B1ms'
    tier: 'Burstable'
  }
  properties: {
    createMode: 'Default'
    version: '13'
    administratorLogin: sqlserverAdminName
    administratorLoginPassword: sqlserverLoginPassword 
    availabilityZone: '1'
    storage: {
      storageSizeGB: 32
    }
    backup: {
      backupRetentionDays: 7
      geoRedundantBackup: 'Disabled'
    }
  }
}
1 Answers

Please follow this git issue here for a similar error that might help you to fix your problem.

Related