[Support Guide] How to connect Azure DevOps repositories to Netlify

Hello friends! Below is a video demo & docs on how to connect Azure DevOps repositories to Netlify.

I hope you find this content useful!

Step 1. Initialize the Netlify site with the Netlify CLI

After installing the CLI, run the following command

netlify init --manual

This command will create a new site in Netlify and give you the ssh key you will need to plugin to your Azure DevOps account. That URL will look something like https://dev.azure.com/{your-user-name}/_usersSettings/keys. You can always grab this key again from https://app.netlify.com/sites/{your-site-slug}/settings/deploys#deploy-key

This netlify init --manual command will also give you back a deploy hook that looks like: https://api.netlify.com/hooks/{hookId}, this hook required a specific payload & is troublesome to work with in Azure DevOps, we can ignore this.

2. Create a new Netlify build hook.

Head into your newly minted Netlify site admin and create a new build hook.
https://app.netlify.com/sites/{your-site-slug}/settings/deploys#build-hooks
Take this new build hook URL and plug it into your Azure DevOps repo under settings & service hooks (See docs on creating service hooks. The service hooks admin URL will look something like https://dev.azure.com/{user-name}/{repo-name}/_settings/serviceHooks

Change code & verify builds in Netlify

Great job so far. Now let’s change our code in Azure DevOps and verify that out webhook is triggering a build inside of Netlify!
Visit https://app.netlify.com/sites/{your-site-slug}/deploys to verify the code change has triggered a Netlify build & deploy.