Microsoft Azure SQL Database
Microsoft Azure SQL Database is a fully managed, relational database-as-a-service (PaaS) offering within the Microsoft Azure cloud platform. It's built on the latest stable version of the SQL Server engine, providing a highly scalable, secure, and intelligent database for modern cloud applications.
In Microsoft Azure
Accessing an Azure SQL Database using Token Authentication
1.1 Log in to Microsoft Azure
- Open your web browser.
- Navigate to: https://portal.azure.comhttps://portal.azure.com
- Sign in with your account credentials.
1.2 Find the App Registrations Service

- In the main search bar at the top of the Azure Portal, type: App Registrations
- Click on App Registrations from the results.
1.3 Create an App in App Registrations

- Click + New registration.
- Fill in the registration form:
Registration Details:
- Name:
Example:
RelyanceScan - Supported account types: Select: “Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)”
- Redirect URI:
- Platform: Web
- URL:
https://root.relyance.ai/api/oauth21.4 Get Your App Credentials
From the app registration Overview page, copy and save:
- Application (client) ID
- Directory (tenant) ID (This is the “home” tenant where your app is registered)
Create a Client Secret:
- Click Add a certificate or secret
- Click + New client secret
- Add a description
- Click Add
- Immediately copy the Value ⚠️ This value will be hidden permanently after leaving the page.




✅ This provides:
client_idclient_secrettenant_id
1.5 Assign Subscription Permissions
1.5.1 Navigate to Subscriptions
- In the Azure Portal, search for Subscriptions
- Click on the subscription you want the app to access
- Verify that databases and SQL servers exist in the resources

1.5.2 Assign IAM Role

Go to Access control (IAM)
Click + Add→ Add role assignment
Select role: Reader
Allows viewing resources without modification
Go to Members tab
Search and select your app’s name
Click Review + assign
1.6 Associate the App Registration with the SQL Server
A. Set the Microsoft Entra ID Admin
This is required for Entra ID-based authentication.
- Navigate to your SQL Server resource (not the database)
- In the left menu, go to Settings → Microsoft Entra ID
- Click Set admin
- Select a user or Entra ID group (group is best practice)
- Click Select
- Click Save
B. Update the Network Firewall
To allow secure access:
- On the SQL Server page, go to: Security → Networking
- Under Firewall rules: Click Add your current client IPv4 address This auto-adds your current public IP
- Add Relyance AI IP Addresses: Open the Relyance AI IP Allow-List page Add each IP as a firewall rule
- Click Save
C. Assign an IAM Role to the App (Server-Level Access)
This allows the app to view Azure resource metadata (not database data).
On the SQL Server page, go to Access control (IAM)
Click + Add → Add role assignment
Select role: Reader
Members tab:
- Assign access to: User, group, or service principal
- Click + Select members
- Search and select your app
Click Review + assign
1.7 Create a Database User for the Application
This grants data access inside the database.
1.7.1 Connect to Database
Connect using an Entra ID account that belongs to the admin group created in step 1.6.A

1.7.2 Run the T-SQL Commands

CREATE USER [your-app-name] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [your-app-name];
In Relyance AI Application
- Login to your Relyance AI account.
- Navigate to the Settings (bottom-left corner).
- Select Integrations.
- Search and locate the Microsoft Azure SQL Database integration card and click on it.
- Click on the Add Connection button on the top right.
- Provide a meaningful name for the integration and click on the Add button.
- In the Overview section, review the Scope and Permission, and Endpoint details and click on Continue. For more details, see Integration Features.
- In the Connection section, provide the appropriate values and click on Continue.
- Connection Name: This property allows you to update the integration specified in Step 6. If you have multiple integrations for the same vendor, you may want to assign distinct names to each. This helps streamline filtering by Discovery Source across the Inventory, Visual Maps, Assets, and Data Flow Analysis pages.
- Rescan Frequency: This property allows you to configure how often Relyance executes scans against this Vendor connection.
- Business Atlas Associations (required): the business entities or products that newly discovered third parties, services and assets from this integration are attributed to. Choose at least one from the Select Associations dropdown — the wizard will not advance past this step without one. For more details, see Business Atlas. Business Atlas
- In the Authentication section, choose Custom (the only method Azure SQL Database offers), provide the following retrieved from the In Microsoft Azure section, and click Authenticate.
Tenant ID
Client ID
Client Secret
Config Options (optional) — which databases to scan. Deny wins over allow, and the pattern is
database.table:{ "allow_list": [], "deny_list": ["database_name.*"] }
- Review the configuration summary from the Completion section and click on Finish.
- Confirm the integration Status reflects Connected.




Verify the connection is really working
This integration authenticates as an Entra ID (Azure AD) application — Tenant ID, Client ID and Client Secret — and then connects to the database as that application. Two layers, and the second is the one that gets missed.
Authentication succeeds and the scan finds no tables. The app registration existing is not the same as the database knowing about it. The application needs a database user created for it and read rights granted:
CREATE USER [<app-registration-name>] FROM EXTERNAL PROVIDER; ALTER ROLE db_datareader ADD MEMBER [<app-registration-name>];Run this in each database you want scanned —
masteris not enough.A timeout rather than a permission error is the server firewall. Azure SQL denies public access by default, so the logical server's Networking panel must admit the Relyance egress IPs for your tenant's region. Add every address listed there, not just one: outbound traffic can come from any of them, so a partial allow-list produces scans that sometimes work.
A connection that worked and then stopped is usually the client secret expiring. Entra ID secrets carry an expiry date — record it in the connection's Credentials expiry field and Relyance will remind you before it lapses.
Fewer databases than expected. Config Options is the scope; left empty every database the application can reach is in scope.
Manage this integration with Terraform
Connections for this integration can be managed as code with the Relyance Terraform provider. Non-secret fields go in auth.params; secret fields go in auth.secrets_wo, which is write-only — never stored in Terraform state. Rotate secrets by bumping auth.secrets_wo_version.
resource "relyance_integration_connection" "azure_sql_db" {
vendor = "azure_sql_db"
name = "<your connection name>"
auth = {
method = "client-credentials"
# Secret fields are write-only: sent to Relyance, never stored in state.
secrets_wo = {
TENANT_ID = var.azure_sql_db_tenant_id
client_id = var.azure_sql_db_client_id
client_secret = var.azure_sql_db_client_secret
}
secrets_wo_version = 1
}
scans = { "data-inspection" = { enabled = true } }
}