🖥️Setup DBGate
This page will guide you to install and setup DBGate correctly on your machine.
Installing DBGate
Head over to the official downloads page for DBGate and select the correct version for your operating system and install it.
Configuring Login Entra ID Admin
Identifying your username
For Entra ID based authentication, you need your username, which is referred to as userPrincipalName in Entra ID. Run this command to get your userPrincipalName:
Please escape any spaces in your user principal name with a backward slash \ (so if your user principal name is: Test User, your username is: Test\ User. If your user principal name does not include spaces, it can be directly used as your username.
az ad signed-in-user show --query "[userPrincipalName]" -o tsv
Creating an access token
This will use Azure CLI to authenticate you and create an access token for you, the access token expires in 5 to 60 minutes, so you might have to regenerate it again. To avoid the hassle follow along the guide and get back to this step when asked during the later stages.
Run this command to generate an access token for accessing PostgreSQL databases:
az account get-access-token --resource-type oss-rdbms --output yamlYou will see your access token with additional information like expiry time.

Creating a Database Connection
Open DBGate and fill in the connection details. Don't forget to name this database, so you can identify it in the future. Here we are using
MRPN Database - AZ Authfor the name so we remember that this database was configured with our AZ CLI generated access token.

Enable SSL for connectivity, as it is mandatory for connectivity. Once done, hit the
TestButton, if you see a green check with success message, save the database using theSavebutton.

Configuring with DB Admin Account
You will need the admin account from the previous step here to be able to log in as an Administrator (not to be confused with Entra Admin)
Duplicate the connection you created from the previous step by right-clicking on the database.

Now edit the newly created connection copy, by right-clicking on it and selecting
Edit

Replace your username and password with the admin credentials, name the database so you can identify this connection has your DB Admin credentials, here we will use the name
MRPN Database - DB Adminso we can reference it correctly in the future. Don't forget to use theTestbutton to verify connectivity and if saving it using theSavebutton.

Last updated