• HOME
  • INTEGRATIONS
  • SDKS
  • GUIDES
  • API DOCS
No results for ""
EXPAND ALL
CLOSE
launchdarkly.com

EDIT ON GITHUB

Azure DevOps (formerly VSTS)

Read time: 2 minutes
Last edited: Oct 16, 2020

Overview

This topic explains how to use Azure DevOps (formerly known as Visual Studio Team Services, or VSTS) integration to control feature flags.

The Azure DevOps integration lets you perform controlled rollouts to manage feature releases. With our integration, you can define a percentage rollout for your feature flags as part of a release task.

Prerequisites

To connect LaunchDarkly and Azure DevOps, you need the following things:

  • A LaunchDarkly API access token with at least write-level access.

To learn more, read API access tokens.

The Azure DevOps integration supports custom roles

If you're using custom roles, you can create an access token with a role targeting environments and feature flags relevant to your Azure DevOps projects. To learn more, read Custom roles.

Connecting to LaunchDarkly

The extension is available on the Azure DevOps Marketplace.

To set up the integration, you must add the LaunchDarkly service endpoint to your Azure DevOps project so the extension can connect to your LaunchDarkly account.

To set up the extension:

  1. Navigate to your Azure DevOps project dashboard.
  2. Navigate to Settings > Services.
  3. Enter a Connection name.
  4. Enter your LaunchDarkly API Access token.
  5. Click Save.

The Azure DevOps "Add new LaunchDarkly Connection screen".
The Azure DevOps "Add new LaunchDarkly Connection screen".

Creating the rollout task

The next step is to add our rollout task to your release definitions.

Rollouts only work with the default collection
You cannot associate rollouts with collections that are not the default. If you do, the rollout won't be able to find the collection.

To find the rollout task:

  1. Navigate to the Add tasks dialog in Azure DevOps.
  2. Click into the Deploy tab.
  3. Choose LaunchDarkly Rollout.

The LaunchDarkly Rollout task in Azure DevOps.
The LaunchDarkly Rollout task in Azure DevOps.

  1. Choose the Account to update. This menu contains the service endpoints you configured in Connecting to LaunchDarkly.
  2. Set a percentage Rollout to apply to your feature flags.
  3. Choose the Flag state. This controls whether the flag is on or off on release.

The task rollout settings.
The task rollout settings.

In this example, any feature flags associated with the release are set to be rolled out to 10% of your users in the LaunchDarkly environment you select.

Configuring authentication

To ensure the task can access your work items, you must allow Azure DevOps to authenticate with LaunchDarkly. This process differs based on which version of the integration you are using. If you don't know which version of the integration you are using, you are probably using the v3 version.

v3 of the Azure DevOps integration

To configure authentication, define some custom variables to pass between Azure DevOps and LaunchDarkly:

  1. Navigate to the Configuration tab of the release page in Azure DevOps.
  2. Enter the launchdarkly-account-name. This is account name of the Azure DevOps account.
  3. Enter the launchdarkly-project-name. This is the project name of the Azure DevOps project.
  4. Enter the launchdarkly-pat. This is for the Azure DevOps personal access token that the integration will use to reach out to the Azure DevOps API.

The v3 variable configuration.
The v3 variable configuration.

Pre-v3 versions of the Azure DevOps integration

To configure authentication, define some custom variables to pass between Azure DevOps and LaunchDarkly:

  1. Navigate to the Configuration tab of the release page in Azure DevOps.
  2. Enter the accountName.
  3. Enter the alternatePassword.
  4. Enter the alternateUsername.
  5. Enter the projectName.

Associating a feature flag with a release

View the feature flags associated with an item from the Work items page.

The LaunchDarkly work items page.
The LaunchDarkly work items page.

When you release to an environment, the rollout task updates any flag you linked with a work item.

This also updates the LaunchDarkly section on your release page. It shows all the feature flags affected by this release.

The LaunchDarkly section of the release page.
The LaunchDarkly section of the release page.