Skip to content

Azure SQL Database

BInbox signs in to Azure SQL Database with a Microsoft Entra access token, over TLS 1.2 or higher with the server’s certificate checked. SQL logins are not offered. The server’s name must end in .database.windows.net.

On New connection, choose Azure SQL Database.

Field What to enter
Server The server’s name, such as myserver.database.windows.net.
Database The database to read.
Port 1433 unless the service says otherwise. You may leave it empty.
How BInbox signs in A service account’s user name and password or key file (the app registration’s client secret) or BInbox’s own identity, trusted by the warehouse (no secret kept).
Directory (tenant) id From the app registration.
Application (client) id From the app registration.
Client secret From the app registration. Service account only.

Follow Set up a Microsoft Entra app registration and keep its three values. Note the app’s display name too (BInbox reader in that guide).

Connect to the database as a Microsoft Entra user who is the server’s Entra administrator, and create a user for the app. A SQL login cannot create this user.

Terminal window
sqlcmd -S myserver.database.windows.net -d <database> -G -Q "CREATE USER [BInbox reader] FROM EXTERNAL PROVIDER; ALTER ROLE db_datareader ADD MEMBER [BInbox reader];"

The same two statements run in the portal’s Query editor when you sign in with Microsoft Entra. The name in brackets is the app registration’s display name.

To read only some schemas, grant SELECT on those schemas instead of adding db_datareader:

CREATE USER [BInbox reader] FROM EXTERNAL PROVIDER;
GRANT SELECT ON SCHEMA::<schema> TO [BInbox reader];

In the portal, open the server, Networking, and check that public network access is on and that the firewall admits the connection. BInbox does not connect from a fixed address yet, so a firewall that admits only listed addresses blocks it. From the command line, az sql server show --name <server> --resource-group <group> --query publicNetworkAccess shows the setting.

Grant Why BInbox needs it
A database user for the app, from EXTERNAL PROVIDER To sign in to the database.
db_datareader, or SELECT on the schemas to read To list and read the tables.

Do not add the app to db_datawriter, db_owner or any server role.

Choose Test connection in BInbox. The first four permissions must be Granted, and the last is optional:

Permission Granted when
Sign in Entra gives a token and the database accepts it over TLS.
List the schemas The app may see at least one schema besides sys, INFORMATION_SCHEMA and guest.
Read at least one table The app has SELECT on at least one table or view.
Run a query A SELECT 1 runs.
Refuse a write, so SQL an author writes can run (optional) BInbox first reads whether the app is in db_owner, db_datawriter or db_ddladmin, and whether it may delete from the first table it may read. If it may, the report says it could write, and no delete is sent. Otherwise the database refuses a delete of no rows from the first table, DELETE FROM <table> WHERE 1 = 0, with error 229 (permission denied), inside a transaction that is rolled back. An app in db_datareader only is refused. The test shows that one table refused, so the role is the control. Without this, authors still pick tables, but cannot write a dataset’s SQL.

If Sign in is refused with a message that the login failed for the app, the CREATE USER ... FROM EXTERNAL PROVIDER statement was not run in that database.

An owner or admin opens the Data tab at app.binbox.ai, chooses Connect, then New connection, fills in the fields above, and chooses Test and save. Connections describes the screen.

Then an author sets up a dataset from one of the connection’s tables or views, as Pick a table describes.