Single Sign-On with Azure Active Directory (Azure AD)

Azure Active Directory can be used as an SSO provider for your Buildkite organization. To complete this tutorial, you will need admin privileges for both Azure and Buildkite.

You can also set up SSO providers manually with GraphQL. See the SSO Setup with GraphQL Guide for detailed instructions and code samples.

Step 1. Create a Buildkite SSO Provider

In your Buildkite Organization Settings, click Single Sign On, then choose the Custom SAML provider from the available options:

Screenshot of the Buildkite SSO Settings Page
  1. Choose the Provide IdP Metadata Later option when configuring your Custom SAML Provider
  2. Copy the Assertion Consumer Service (ACS) URL for use in Step 2

Step 2. Add Buildkite in Azure AD

In your Azure Admin Console, follow these instructions:

  1. Choose Azure Active Directory, and under Quick actions, choose Add enterprise application
  2. Click + Create your own application
  3. Give your application a name, for example 'Buildkite'
  4. Choose Integrate any other application you don't find in the gallery (Non-gallery) and click Create
  5. Choose Set up single sign on, then SAML, then in the Basic SAML Configuration box, choose Edit
  6. Enter the following configuration and save:
    • Identifier (Entity ID): https://buildkite.com
    • Reply URL (Assertion Consumer Service URL): the ACS URL you copied in Step 1
  7. Copy the App Federation Metadata Url value from the SAML Signing Certificate box for use in Step 3

Step 3. Update your Buildkite SSO Provider

On your Buildkite Organization Settings Single Sign On page, select the Custom SAML provider from the list of Configured SSO Providers.

  1. Click the Edit Provider button, choose the Configure Using IdP Meta Data URL option, and enter the App Federation Metadata Url you copied in Step 2
  2. Save your new settings and you'll be returned to your Custom SAML provider page

Step 4. Perform a Test Login

On your Custom SAML provider page, click Perform Test Login to verify that SSO is working correctly before you activate it for your organization members.

If you receive an error from Microsoft about the user not being assigned to the application, you can assign an initial user:

  1. In your Azure Admin Console, select the new Buildkite enterprise app
  2. Choose Users and groups from the navigation sidebar
  3. Click Add user/group
  4. Select the user and click Assign

Then, on your Buildkite Organization Settings Single Sign On page, select the Custom SAML provider from the list of Configured SSO Providers, and retry the test login.

Step 5. Enable the new SSO Provider

Once you've performed a test login you can enable your SSO provider using the Enable button. Enabling the SSO provider will not force a log out of any signed in users, but will cause all new or expired sessions to authorize through Azure AD before accessing any organization data.

If you need to edit or update your Azure Active Directory provider settings, you will need to disable the SSO provider first.

Using SCIM to provision and manage users

Enterprise customers can automatically add and remove user accounts from their Buildkite organization using the SCIM provisioning settings in Azure AD.

Supported SCIM Features

  • Create Users
  • Deactivate Users (Deprovisioning)

You will not be billed for users that you add to Azure AD until they have signed in to your Buildkite organization.

Configuration instructions

Adding and removing users accounts in Azure AD is called Provisioning. You need an enabled Azure AD SSO Provider for your Buildkite Organization before you can set up SCIM provisioning.

After enabling your Azure AD SSO Provider in Buildkite, get the Base URL and API Token from your Azure AD SSO Provider Settings:

Screenshot of the Buildkite Settings SCIM Deprovisioning section

Then go to your Azure Admin Console and select the new Buildkite enterprise app to set up provisioning:

  1. Choose Provisioning from the navigation sidebar, click Get started
  2. Select Automatic provisioning mode and enter the following details:
    • Tenant URL: the Base URL from your Buildkite SSO Provider settings
    • Secret Token: the API Token from your Buildkite SSO Provider settings
  3. Click Test Connection, and when you receive confirmation the settings are valid, save
  4. Disable Group synchronization:
    1. Expand Mappings, then click Provision Azure Active Directory Groups
    2. Toggle Enabled to No and click Save
  5. Customise the User mappings:
    1. Expand Mappings, then click Provision Azure Active Directory Users
    2. Keep the following four mappings, and delete any others:
      • userPrincipalName to userName
      • Switch([IsSoftDeleted], , "False", "True", "True", "False") to active
      • givenName to name.givenName
      • surname to name.familyName
  6. Toggle Provisioning Status to On and save
  7. Return to the Provisioning menu of your Azure AD enterprise app and view the Current cycle status section:
    • If provisioning is working, this will say Initial cycle completed
    • If errors are displayed, click View provisioning logs for more details on what went wrong