Hi MAHESHI GUNARATNE •,
Welcome to Microsoft Q&A forum and thanks for using Azure Services.
As I understand, you are getting connection timed out when trying to connect to Azure PostgreSQL Database.
We are sorry about the inconvenience you are facing.
Could you please share below information to us:
Is the server Data Encrypted with CMK?
If yes, make sure these requirements are met https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-data-encryption#requirements-for-configuring-data-encryption-for-azure-database-for-postgresql-flexible-server and check if connection to Key Vault exists.
What is the Region in which this server was created?
What is the configuration of the Flexible Server?
Transient errors occur when maintenance is performed, the system encounters an error with the hardware or software, or you change the vCores or service tier of your server. The Azure Database for PostgreSQL service has built-in high availability and is designed to mitigate these types of problems automatically. However, your application loses its connection to the server for a short period of time of typically less than 60 seconds at most. Some events can occasionally take longer to mitigate, such as when a large transaction causes a long-running recovery.
Also refer to https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-limits
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-troubleshoot-common-connection-issues
Thanks.