Hi Kiarash Azarnia,
Thank you for Reaching microsoft Q&A!.
We’ve reviewed your configuration and the PostgreSQL Flexible Server itself is healthy. The Protection Error you’re seeing is not caused by Terraform or the backup policy, but by a missing service prerequisite.
For Azure Backup (VaultStore) with PostgreSQL Flexible Server, RBAC permissions alone are not sufficient. During protection enablement and backup validation, the Azure Backup service must be able to reach the PostgreSQL server over the network.
In your current setup, the issue is caused by one or both of the following:
Public network access is disabled on the PostgreSQL Flexible Server, or “Allow Azure services to access this server” is not enabled in the firewall settings.
When the backup service cannot connect to the server, the platform returns the generic error PostgreSQLFlexOperationFailedUserError, even though the server itself is healthy.
To resolve the issue, please ensure the following:
Enable Public network access on the PostgreSQL Flexible Server. Under Firewall rules, enable Allow public access from Azure services.
Additionally, please note that the Backup Operator role is not the correct role for PostgreSQL Flexible Server backups. The Backup Vault’s managed identity must be assigned the PostgreSQL Flexible Server Backup Operator role at the server scope. No Long-Term Retention role is required for Flexible Server backups.
There are no known regional issues with VaultStore backups for PostgreSQL Flexible Server in eu-central or other regions.
After updating the firewall settings and correcting the role assignment, allow a few minutes for propagation and then retry the protection operation. The backup instance should automatically transition from Protection Error to Protected.
If you want, I can also help validate the exact role definition name in Terraform to avoid RBAC mismatches.