Warehouses

Connect Azure SQL

Connect an Azure SQL database as a Microsoft Entra service principal that can only read, from Ahamo's fixed address.

On this page

The Azure SQL connector signs in to one Azure SQL database as a Microsoft Entra service principal, an app's client ID and secret. To sign in with a SQL login instead, see Connect SQL Server.

Availability. The Azure SQL connector must be on for your workspace. See Connect a data warehouse.

Set up the service principal

  1. In the Microsoft Entra admin center, open App registrations and register an app for Ahamo. Under Certificates & secrets, add a client secret. Note the Application (client) ID and the Directory (tenant) ID.

  2. The server needs a Microsoft Entra admin. As that admin, in the database, make a user for the app and add it to db_datareader only, with the app's own name.

    CREATE USER [ahamo-reader] FROM EXTERNAL PROVIDER;
    ALTER ROLE db_datareader ADD MEMBER [ahamo-reader];
  3. In the server's Networking › Firewall rules, allow Ahamo's fixed address.

Grant nothing else. When you connect, Ahamo checks that the service principal can't write, and refuses one that can.

The SQL Server connect dialog shows Ahamo's fixed address. Azure SQL uses the same one.

Connect

  1. Open Connectors, find Azure SQL and choose Connect.
  2. Enter the server name, such as myserver.database.windows.net, the port, the database name and the Microsoft Entra tenant ID. The port is 1433. A Managed Instance reached from outside Azure uses 3342.
  3. Paste the app's Application (client) ID and the secret's value. Ahamo keeps the secret encrypted and never shows it again.
  4. Name the connection, choose who may use it, and choose Test and connect.

A client secret expires, after at most two years. Add a new one before then, and paste it with Paste a new key on the connection.

Statements run as for SQL Server, with the same limits.

Troubleshooting

Microsoft Entra didn't accept the client ID and secret. Paste the Application (client) ID and the secret's value, not its ID, and check the tenant ID.

Azure SQL didn't let the service principal into this database. Make the app's user in this database with CREATE USER … FROM EXTERNAL PROVIDER.

This service principal can change data, so Ahamo doesn't connect with it. Make its user only a member of db_datareader.

Ahamo couldn't reach the server. Check the server name and port, and allow Ahamo's fixed address in the server's firewall.

Azure SQL no longer accepts this connection's secret. The client secret expired. Add a new one to the app and paste it with Paste a new key.

On this page