@Abhay Gupta Thank you for posting your question on Microsoft Q&A and for using Azure services.
In my understanding, you are not able to connect to your PostgreSQL from pgadmin installed on your local machine because of some network issues but looks like it is related to some networking issues.
If you want to connect to the flexible server from a client that is provisioned in another VNET, you have to link the private DNS zone with the VNET. See this linking the virtual network documentation on how to do it. Please let me know if that is not the ask here.
how Azure pipelines will connect to it for scripts deployments etc.
You can automatically deploy your database updates to Azure Database for PostgreSQL Flexible Server after every successful build with Azure Pipelines.