I have an Azure PostgreSQL server that is giving different connection results in Azure Data Studio (with the PG extension) depending on how the resource's AD Admin setting is configured. With the AD Admin set to an AD security group that I'm a member of, I get "server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request." Setting the AD Admin to my AD user account lets me connect successfully.

Using the same AD group as the AD Admin setting for our Azure SQL Databases lets my user account in fine in ADS and SSMS.


1 Answer 1


Microsoft's Azure support cleared it up. Have to use the ADSecurityGroupName@postgresqlservername as the User Name in Azure Data Studio (and I assume psql or pgadmin). ADS still used my AD user account with MFA in the Account field.

Note the AD security group format is different from an AD user account for the User Name, where the AD user account uses [email protected]@pgservername.

One thing I'm not clear about is whether this pattern is only used for the AD Admin setting AD group/members, or if it's any AD group that has a role created for it (e.g. security groups that are added to the azure_ad_user role).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.