PostgreSQL deployment via ARM template failing due to too many configurations' changes.
As per the MSdoc and MSdoc the issue might due to the inconsistent way of providing configuration files and failed to establish the dependancy.
The cause of this can be countered the by making the applying the configurations in smaller batches to avoid unbearable load the server with too many changes at once.
The configuration schema goes as follows
main.bicep:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"name": "[parameters('serverName')]",
"location": "[parameters('location')]",
"properties": {
"administratorLogin": "[parameters('administratorLogin')]",
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
"version": "[parameters('version')]"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/configurations",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('serverName'), '/config1')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('serverName'))]"
],
"properties": {
"value": "[parameters('config1Value')]"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/configurations",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('serverName'), '/config2')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('serverName'))]"
],
"properties": {
"value": "[parameters('config2Value')]"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/configurations",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('serverName'), '/config3')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('serverName'))]"
],
"properties": {
"value": "[parameters('config3Value')]"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/configurations",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('serverName'), '/config4')]",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('serverName'))]"
],
"properties": {
"value": "[parameters('config4Value')]"
}
}
// Add more configuration resources here in batches
],
"parameters": {
"serverName": {
"type": "string"
},
"location": {
"type": "string"
},
"administratorLogin": {
"type": "string"
},
"administratorLoginPassword": {
"type": "securestring"
},
"version": {
"type": "string",
"defaultValue": "11"
},
"config1Value": {
"type": "string"
},
"config2Value": {
"type": "string"
},
"config3Value": {
"type": "string"
},
"config4Value": {
"type": "string"
}
}
}
Deployment:
Depends on the number of configurations the resources will be created without any internal server issue due to load as the configuration was made in batches.

Refer:
Quickstart: Create an Azure Database for PostgreSQL - ARM template | Microsoft Learn
Deploying PostgreSQL Flexible Server with azure.extensions parameter in ARM template fails with InternalServerError - Microsoft Q&A