LaunchDarkly Developer Documentation

Get started in under 30 minutes.
LaunchDarkly provides feature flags as a service for Java · Python · Ruby · Go · Node.js · PHP · .NET. Control feature launches -- who sees what and when -- without multiple code deploys. Easy dashboard for phased rollouts, targeting and segmenting.
Need more help? write us at support@launchdarkly.com

Get Started    Documentation

Azure DevOps Services (VSTS)

Overview

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

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

Prerequisites

To connect LaunchDarkly and VSTS, you need the following things:

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

To learn more, read Personal API access tokens.

The VSTS 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 VSTS projects.

To learn more, read Custom roles.

Connecting to LaunchDarkly

The extension is available on the Visual Studio Marketplace.

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

To set up the extension:

  1. Navigate to your VSTS project dashboard.
  2. Navigate to Settings > Services.
  3. Enter a Connection name.
  4. Enter your LaunchDarkly API Access token.
  5. Click Save.
The VSTS "Add new LaunchDarkly Connection screen".

The VSTS "Add new LaunchDarkly Connection screen".

Creating the rollout task

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

To find the rollout task:

  1. Navigate to the Add tasks dialog in VSTS.
  2. Click into the Deploy tab.
  3. Choose LaunchDarkly Rollout.
The LaunchDarkly Rollout task in VSTS.

The LaunchDarkly Rollout task in VSTS.

  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 VSTS 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 VSTS integration

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

  1. Navigate to the Configuration tab of the release page in VSTS.
  2. Enter the launchdarkly-account-name.
  3. Enter the launchdarkly-project-name.
  4. Enter the launchdarkly-pat. This is the personal API access token.
The v3 variable configuration.

The v3 variable configuration.

Pre-v3 versions of the VSTS integration

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

  1. Navigate to the Configuration tab of the release page in VSTS.
  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.


Azure DevOps Services (VSTS)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.