1. Go to User settings -> Personal access tokens (in a top right section of the Azure DevOps page)
Personal access tokens menu in Azure DevOps
2. On the Personal Access Tokens page click + New Token
Personal Access Tokens page in Azure DevOps
3. Create a new personal access token. There, you will need to set the name of your token, expiration and scope. For Spacelift give it Code(Source code, repositories, pull requests and notifications) Read & write access.
Creating a new personal access token in Azure DevOps
4. Once the token is created, put it into the Personal access token field on the Spacelift Azure DevOps setup form.
Successfully created Personal Access Token in Azure DevOps
After doing all this you should have all fields filled in.
Filled in Azure DevOps integration form
If all the data is correct, after saving you should see two notifications in the bottom right part of Spacelift: New integration was created; and Connecting to Azure DevOps succeeded. You can find your webhook endpoint and webhook password under the Azure DevOps VCS integration section:
Configured Azure DevOps integration
For each Azure DevOps project you want to use with Spacelift, you now have to go into its Project settings -> Service hooks -> Create subscription. Within the services list choose Webhook and click Next.
Creating a Webhook integration in Azure DevOps
We will need to create two integrations: Code pushed and Pull request created. Let's first create Code pushed integration.
Once on the Trigger page of New Service Hooks Subscription window, select Code pushed in the Trigger on this type of event dropdown and click Next.
Creating Code pushed webhook integration in Azure DevOps
After clicking Next you should see the Action page. Under the Settings section fill in the Spacelift Webhook endpoint URL. Leave Basic authentication username empty and put the Webhook password under Basic authentication password and click Finish.
Configuring webhook integration in Azure DevOps
Once done you should see the list of configured Service Hooks. Repeat the same process for the Pull request created trigger event. Afterwards you should see the configured webhooks on the Service Hooks settings page.
Service Hooks page with two configured webhook integrations in Azure DevOps
When creating a Stack, you will now be able to choose the Azure DevOps provider and a repository inside of it:
Stack creation form
Unlinking the Integration
If you no-longer need the integration, you can remove it via the Unlink button on the VCS settings page.
VCS providers page
Please also remember to remove any Spacelift webhooks from your repositories.