Hi Daan de Bruin,
Thank you for clarifying! You're absolutely right the 502 Bad Gateway / ServerUnableToRetriveData during config changes on existing PostgreSQL Flexible Server resources is a Microsoft.DBforPostgreSQL resource provider issue in Canada Central's control plane failing to retrieve metadata. This exact pattern has been reported there since Jan 20.Verify Platform Fault (30 seconds):Test this direct ARM GET call (replace your sub/rg/server):
text
az rest --method get --url "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{server}/databases?api-version=2021-06-01"
Same 502 confirms it's the RP, not your Terraform.
Unblock Immediately:
Skip Terraform refresh (safest/fastest):
text
terraform plan -refresh=false -out=tfplan
terraform apply tfplan
OR bypass ARM databases (data plane always works):
text
psql "host=yourserver.postgres.database.azure.com port=5432 dbname=postgres sslmode=require" -c "CREATE DATABASE yourdb;"
Current status:
No broad Canada Central PostgreSQL outages showing on Azure Status today (Jan 29), but this matches multiple customer reports of RP metadata timeouts in the region. Check your Service Health blade and Activity Log correlation IDs (x-ms-correlation-request-id) for tracking.
While Waiting for RP Stability
text
# Pin older stable API version with AzAPI provider
resource "azapi_resource" "db" {
type = "Microsoft.DBforPostgreSQL/flexibleServers/databases@2021-06-01"
# ... your config
}
The terraform plan -refresh=false will keep you moving today. Test the ARM repro and share correlation IDs/timestamps here . Let me know the results!