Open srdjanrilak-ms opened 2 months ago
@surajssd Could this be connected to the mysql installing the server version rather than client version? Unlikely but surprised we're not seeing issues for escape characters not working outside of psql
So this issue was before we removed the mysql package.
Also I think this can be broken down into two steps to see if it works:
export PS_PASS="$(az account get-access-token --resource-type oss-rdbms --output tsv --query accessToken)"
psql "host=entera-test-2.postgres.database.azure.com port=5432 dbname=postgres user=srdjanrilak@microsoft.com password=${PS_PASS} sslmode=require"
My hunch is that the sub-query which gets password is not being evaluated but is getting interpreted as a string.
@srdjanrilak-ms has the above recommendation worked for you?
To Reproduce
If one creates an instance of PostgreSQL service (FSPG) with AAD enabled and tries to connect to it on Portal using bash as a shell and AAD login, the console will show an error and psql will not be connected.
It looks like the bash command for psql does not use escape characters correctly.
The generated command fails, but if I run very similar one with different escaping, it works. Screenshot shows the command that fails. The one that works is following psql "host=entera-test-2.postgres.database.azure.com port=5432 dbname=postgres user=srdjanrilak@microsoft.com password='$(az account get-access-token --resource-type oss-rdbms --output tsv --query accessToken)' sslmode=require"
Observed Behavior
Already described in the previous section.
Expected behavior
The psql tool should be connected to the database on the startup.
Is this specific to Cloud Shell?
Running the correct command outside the cloud shell works fine.
Interface information
I access cloud shell with Edge browser on Windows Server 2022. Used bash on web.