Welcome to the Alteryx Knowledge Base
Created/Edited -
Please follow the steps outlined in this article to use a service principal to connect to Azure SQL Database.
- Alteryx Designer/Server
- Version >= 2024.1
- Microsoft Azure SQL Database
- ODBC Driver 17 for SQL Server/ODBC Driver 18 for SQL Server
IMPORTANT: Sections A and B require the administrator for both services to perform the steps.
A. Create an Entra (formerly known as Azure AD) Application
- Go to Azure Portal.
- Go to Microsoft Entra ID > App Registrations.
- Create a new application and set the account type accordingly. Redirect URI is not needed here for the service principal.
- Note down the application name and the client ID after registering the application.
- Go to Certificates & secrets and create a new client secret,
- Note down the secret value immediately once created.
B. Add the Service Principal to the Database
- Using SQL Server Management Studio, log in to the Azure SQL Database using the Entra Admin account.
- Run the following script to add the service principal to the database and assign the appropriate roles.
CREATE USER [<AZURE_APP_NAME>] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [<AZURE_APP_NAME>];
ALTER ROLE db_datawriter ADD MEMBER [<AZURE_APP_NAME>];
ALTER ROLE db_ddladmin ADD MEMBER [<AZURE_APP_NAME>];
NOTE: Replace "<AZURE_APP_NAME>" with the name of the Entra application created in step 4 of section A. The roles to add to the service principal are just suggestions. If your organisation uses a different set of roles or permissions, please use them instead. Please refer to this site for details of the mentioned roles.
Example
Azure app name: Azure SQL
CREATE USER [Azure SQL] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [Azure SQL];
ALTER ROLE db_datawriter ADD MEMBER [Azure SQL];
ALTER ROLE db_ddladmin ADD MEMBER [Azure SQL];
C. Use the Service Principal in Alteryx
- In Designer, add an Input Data tool to the workflow canvas.
- Configure the tool to use the Data Connection Manager (DCM), if optional.
- In the Data Connections window, click the Data Sources on the left pane.
- Click the Quick Connect link under the Microsoft SQL Server section.
- Create a new connection, datasource and credentials.
- For the authentication method, please select Azure Active Directory Service Principal.
Example from Designer version 2025.2
NOTE: The connection manager user interface may differ across different versions.
- Enter the Client ID and Client Secret that were noted down in Section A.
- Click the Connect button after creation.
D. Test the Service Principal in ODBC Data Sources Administrator [OPTIONAL]
- In the ODBC Data Sources Administrator (64-bit), add a new data source using the ODBC Driver 17 for SQL Server or ODBC Driver 18 for SQL Server.
- Enter a name for the data source and the server to connect to.
- At the "How should SQL Server verify the authenticity of the Login ID?" step, select the "With Azure Service Principal authentication" option.
- Enter the client ID in the Login ID field and the secret in the Password field.
- Click the Next button until you see the Finish button and click it.
- Click the Test Data Source button to verify if the service principal authentication works.
You should see the following when the connection is successful.
NOTE: This ODBC data source is not used in Alteryx Quick Link. These steps are used to verify whether the obtained information regarding the server, client ID and secret works.