Set up Azure DevOps enterprise
Service principal overview
You can use these instructions to create a service principal app. The service principal feature is being gradually rolled out to dbt Cloud accounts, so it may not be available in all accounts.
If you need to configure dbt Cloud and Azure DevOps but don't see the Service principal option in your account settings, use the Service user configuration for now. You can easily migrate to a service principal when available for your account.
To use dbt Cloud's native integration with Azure DevOps, an account admin needs to set up a Microsoft Entra ID app as a service principal. We recommend setting up a separate Entra ID application than used for SSO.
The application's service principal represents the Entra ID application object. While a "service user" represents a real user in Azure with an Entra ID (and an applicable license), the "service principal" is a secure identity used by an application to access Azure resources unattended. The service principal authenticates with a client ID and secret rather than a username and password (or any other form of user auth). Service principals are the Microsoft recommended method for authenticating apps.
Once the Microsoft Entra ID app is added to dbt Cloud, it will act as a service principal, which will be used to power headless actions in dbt Cloud such as deployment runs and CI. The dbt Cloud developers can then personally authenticate in dbt Cloud from Azure DevOps. For more, see Authenticate with Azure DevOps.
The following personas are required to complete the steps on this page:
- Microsoft Entra ID admin
- Azure DevOps admin
- dbt Cloud account admin
- Azure admin (if your Entra ID and Azure DevOps environments are not connected)
Register a Microsoft Entra ID app
A Microsoft Entra ID admin needs to perform the following steps:
- Sign into your Azure portal and click Microsoft Entra ID.
- Select App registrations in the left panel.
- Select New registration. The form for creating a new Entra ID app opens.
- Provide a name for your app. We recommend using, "dbt Labs Azure DevOps app".
- Select Accounts in any organizational directory (Any Entra ID directory - Multitenant) as the Supported Account Types. Many customers ask why they need to select Multitenant instead of Single Tenant, and they frequently get this step wrong. Microsoft considers Azure DevOps (formerly called Visual Studio) and Microsoft Entra ID separate tenants, and for the Entra ID application to work properly, you must select Multitenant.
- Set Redirect URI (optional) to Web. Copy and paste the Redirect URI from dbt Cloud into the next field. To find the Redirect URI in dbt Cloud:
- In dbt Cloud, navigate to Account Settings -> Integrations.
- Click the edit icon next to Azure DevOps.
- Copy the first Redirect URIs value which looks like
https://<YOUR_ACCESS_URL>/complete/azure_active_directory
and does NOT end withservice_user
.
- Click Register.
Here's what your app should look like before registering it:
Create a client secret
A Microsoft Entra ID admin needs to complete the following steps:
- Navigate to Microsoft Entra ID, click App registrations, and click on your app.
- Select Certificates and Secrets from the left navigation panel.
- Select Client secrets and click New client secret
- Give the secret a description and select the expiration time. Click Add.
- Copy the Value field and securely share it with the dbt Cloud account admin, who will complete the setup.
Create the app's service principal
After you've created the app, you need to verify whether it has a service principal. In many cases, if this has been configured before, new apps will get one assigned upon creation.
-
Navigate to Microsoft Entra ID.
-
Under Manage on the left-side menu, click App registrations.
-
Click the app for the dbt Cloud and Azure DevOps integration.
-
Locate the Managed application in local directory field and, if it has the option, click Create Service Principal. If the field is already populated, a service principal has already been assigned.
Add permissions to your service principal
An Entra ID admin needs to provide your new app access to Azure DevOps:
- Select API permissions in the left navigation panel.
- Remove the Microsoft Graph / User Read permission.
- Click Add a permission.
- Select Azure DevOps.
- Select the user_impersonation permission. This is the only permission available for Azure DevOps.
Add a role to service principal
This section will require an Azure admin to complete.
To add a role to your service principal:
- In your Azure account, navigate to Subscriptions and select an existing subscription.
- From the left-side menu, click Access Control (IAM) -> Add -> Add role assignment.
- From the Role tab, select a role with appropriate permissions to assign the service principal.
- Continue to the Members tab and assign access to User, group, or service principal.
- Click *Select members and find your app in the search bar.
- Once your app has been selected, click Review and Assign.
Connect Azure DevOps to your new app
An Azure admin will need one of the following permissions in both the Microsoft Entra ID and Azure DevOps environments:
- Azure Service Administrator
- Azure Co-administrator
You can only add a managed identity or service principal for the tenant to which your organization is connected. You need to add a directory to your organization so that it can access all the service principals and other identities. Navigate to Organization settings --> Microsoft Entra --> Connect Directory to connect.
- From your Azure DevOps account organization screen, click Organization settings in the bottom left.
- Under General settings, click Users.
- Click Add users, and in the resulting panel, enter the service principal's name in the first field. Then, click the name when it appears below the field.
- In the Add to projects field, click the boxes for any projects you want to include (or select all).
- Set the Azure DevOps Groups to Project Administrator.
Connect your Microsoft Entra ID app to dbt Cloud
A dbt Cloud account admin must take the following actions.
Once you connect your Microsoft Entra ID app and Azure DevOps, you must provide dbt Cloud information about the app. If this is a first-time setup, you will create a new configuration. If you are migrating from a service user, you can edit an existing configuration and change it to Service principal.
To create the configuration:
- Navigate to your account settings in dbt Cloud.
- Select Integrations.
- Scroll to the Azure DevOps section and click the Edit icon.
- Select the Service principal option (service user configurations will auto-complete the fields, if applicable).
- Complete/edit the form (if you are migrating, the existing configurations carry over):
- Azure DevOps Organization: Must match the name of your Azure DevOps organization exactly. Do not include the
dev.azure.com/
prefix in this field. ✅ Usemy-DevOps-org
❌ Avoiddev.azure.com/my-DevOps-org
- Application (client) ID: Found in the Microsoft Entra ID app. Client Secrets: Copy the Value field in the Microsoft Entra ID app client secrets and paste it into the Client Secret field in dbt Cloud. Entra ID admins are responsible for the expiration of the app secret, and dbt Admins should note the expiration date for rotation.
- Directory(tenant) ID: Found in the Microsoft Entra ID app.
- Azure DevOps Organization: Must match the name of your Azure DevOps organization exactly. Do not include the
Your Microsoft Entra ID app should now be added to your dbt Cloud Account. People on your team who want to develop in the dbt Cloud IDE or dbt Cloud CLI can now personally authorize Azure DevOps from their profiles.
Migrate to service principal
Migrate from a service user to a service principal using the existing app. It will only take a few steps, and you won't experience any service disruptions.
- Verify whether or not your app has a service principal
- If not, create the app service principal
- Update the application's configuration
- Update the configuration in dbt Cloud
Verify the service principal
You will need an Entra ID admin to complete these steps.
To confirm whether your existing app already has a service principal:
- In the Azure account, navigate to Microsoft Entra ID -> Manage -> App registrations.
- Click on the application for the service user integration with dbt Cloud.
- Verify whether a name populates the Managed application in local directory field.
- If a name exists, continue to the next step from the add a role to your service principal and follow the remaining instructions.
- If no name exists, go to the next section, Create the service principal.
- Follow the instructions to add permissions to your service principal.
- Follow the instructions to connect DevOps to your app.
- In your dbt Cloud account:
- Navigate to Account settings and click Integrations
- Click the edit icon to the right of the Azure DevOps settings.
- Change Service user to Service principal and click Save. You do not need to edit any existing fields.
Create the service principal
If there is no name populating that field, a Service Principal does not exist. To configure a Service Principal, please review the instructions here.
If your dbt Cloud app does not have a service principal, take the following actions in your Azure account:
-
Navigate to Microsoft Entra ID.
-
Under Manage on the left-side menu, click App registrations.
-
Click the app for the dbt Cloud and Azure DevOps integration.
-
Locate the Managed application in local directory field and click Create Service Principal.
-
Follow the instructions to add permissions to your service principal.
-
Follow the instructions to connect DevOps to your app.
-
In your dbt Cloud account:
- Navigate to Account settings and click Integrations
- Click the edit icon to the right of the Azure DevOps settings.
- Change Service user to Service principal and click Save. You do not need to edit any existing fields.