Connecting to external database using phoenix app, getting timeout

I’m trying to connect to an external azure postgres database but I’m constantly getting a timeout error:

[error] Postgrex.Protocol (#PID<0.1867.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect ( timeout 

I have already set socket_options: [] inside theruntime.exs file so I’m not using the inet6 option at all.

Anyone has any idea?