Sorry about the comment I provided above regarding deploying an Azure PostgreSQL Flexible server version 16 using biceps.
I was able to test this, and it was successfully.
I did a test by creating a biceps template to deploy an azure PostgreSQL Flexible server public access.
Below is the sample, and you can change the Sku, tier, storage, and other variables based on your needs, and add others based on our documentation deployment-language-bicep.
@description('The name of the PostgreSQL Flexible Server')
param serverName string = 'name-postgres-server1'
@description('The administrator username for the Flexible Server')
param adminUsername string
@description('The administrator password for the Flexible Server')
@secure()
param adminPassword string
@description('The storage size in GiB for the Flexible Server')
param storageSizeGb int = 32
@description('The backup retention days for the Flexible Server')
param backupRetentionDays int = 7
@description('The location of the resources')
param location string = resourceGroup().location
resource postgreSqlFlexibleServer 'Microsoft.DBforPostgreSQL/flexibleServers@2023-06-01-preview' = {
name: serverName
location: location
sku: {
name: 'Standard_D4ds_v5'
tier: 'GeneralPurpose'
}
properties: {
administratorLogin: adminUsername
administratorLoginPassword: adminPassword
version: '13'
network: {
publicNetworkAccess: 'Disabled'
}
storage: {
storageSizeGB: storageSizeGb
}
backup: {
backupRetentionDays: backupRetentionDays
}
highAvailability: {
mode: 'Disabled'
}
}
}
You can save the file, then run the deployment using CLI in the Azure Portal.
And run the deployment:
az deployment group create --resource-group Rgname --template-file <BicepFileName> --parameters adminUsername=adminname adminPassword="password"
Please see image below
You need to upload the file, then Open Azure CLI to run the above code.
Hope that clarifies.
Note: If you are deploying using private access the template will be different.
Please don't forget to mark as accept answer if the reply was helpful so that others experiencing the same thing can easily reference this.
Regards,
Oury