Open navClose nav

Azure DevOps

Forestry supports syncing with static sites stored in Azure DevOps repos.

Currently, in order to use Azure DevOps as a source provider, you must use Manual Setup to set up the repository connection.

Getting Started

To set up a site whose code is hosted on Azure DevOps, click the Add Site button on your dashboard, and select Azure DevOps as a source provider. You will notice that the Quick Setup via OAuth toggle automatically switches off, because Quick Setup is not available for Azure DevOps repos.

Setting the Repo Location,dpr_auto,f_auto,q_80,w_640/

After you click Next, you will be prompted to enter the repository URL, the branch you wish to import, and (if you are importing a Jekyll or Hugo site,) the config path. The repository URL should be the SSH URL, not the HTTPS URL.

Completing the Connection

After you enter your repo information and click Next, you will be taken to the repository settings screen on your site dashboard. This screen will give you access to the information that needs to be added to your git provider’s settings.,dpr_auto,f_auto,q_80,w_640/

Setting the Public Key

To add a new key to Azure DevOps, navigate to$USERNAME/_usersSettings/keys, where $USERNAME is your username in Azure DevOps.

Click Add to add a new key. You can use the Description field to add an identifier for this key so you will know what it’s being used for later on. In the Key Data field, paste in the public key provided by Forestry. Click the Save button to save this key.

After setting up the key, navigate back to the site settings in Forestry and click Re-import from azuredevops. If the key has been set up correctly, this will initiate an import of your site to Forestry.

Setting up the Webhook

To add a webhook to your Azure DevOps Repository, navigate to$ORGANIZATION/$PROJECT/_settings/serviceHooks, substituting $ORGANIZATION and $PROJECT for the name of the Azure DevOps organization and project you want to add hooks for. This will take you to the Service Hooks area of the project settings.,dpr_auto,f_auto,q_80,w_640/

Click on Create Subscription, select Web Hooks from the available services, and then click Next.

Here you will configure the type of webhook to send. Select Code pushed for the trigger, and select the repository and branch that corresponds to your site in Forestry. Under Pushed by a member of group, use the default selection of [Any]. Click Next to continue configuring the webhook.,dpr_auto,f_auto,q_80,w_640/

On this last configuration screen, paste in the Webhook URL from your site’s settings page in Forestry and ensure the Resource Version is set to 1.0. No further changes are necessary on this screen, so you can click Finish To create the webhook.

If you want, you can remove the messages from the payload on this configuration screen, because they are not used by Forestry. However, you must select All for Resource details to send.
Clicking Test to test the Azure DevOps webhook will not cause Forestry to import your site, because Azure sends a dummy payload in the test hook.

Last updated on April 29, 2019