Skip to main content

Azure DevOps Services (Cloud)

Overview

BeetleboxCI supports Azure DevOps Services integration, which is the recommended method for connecting Azure DevOps repositories. Azure DevOps pipelines can also be created manually. This requires users to provide the repositories, alongside credentials to access those repositories if needed. Please note that pull requests cannot be detected on repositories that are added using the manual method.

BeetleboxCI supports both Azure DevOps Services (cloud-based) and Azure DevOps Server (on-premises).

Integrating BeetleboxCI with Azure DevOps Services

Create a Personal Access Token

The first stage is to create a personal access token for BeetleboxCI to use in order to connect to your Azure DevOps account.

Please note that on Azure DevOps services, there is no distinction between the username and organisation.

  1. Switch to the correct organisation for which you want to create the token by going to the Azure Devops homepage (click the Azure DevOps logo on the top left) and select the correct organisation from the left-hand column.
  2. Click the User Settings button on the top right hand corner of the screen and select Personal access tokens.
  3. Click the New Token button.
  4. Choose a suitable name that allows you to identify the token and an expiration time.
  5. Ensure that the correct organisation is selected on the dropdown menu. You may wish to allow this token to grant access to all organisations if needed.
  6. Scroll down to Scopes, ensure that under Code, the Read & write and Status options are selected, and then click Create.
  7. Copy the token and save it somewhere safe, as you will not be able to see it again.

It is also possible to create a token by going to any of your existing repositories (this token will still have access to all repositories in your organisation)

  1. Browse to an Azure DevOps repository in an Azure DevOps project at https://dev.azure.com/<organisation_name>/_git/<project_name>
  2. Press the Clone button.
  3. Click Generate Git Credentials. This will generate a username and password which you can use to access your repositories.
  4. Save these credentials in a secure place as you will not be able to see them again.
  5. You will need to edit the scope of this token to allow BeetleboxCI to access your repositories correctly. Click the User Settings button on the top right hand corner of the screen and select Personal access tokens.
  6. Select the token you just created and click Edit.
  7. Scroll down to Scopes, ensure that under Code, the Read & write and Status options are selected, and click Save.

Create an SSH Key (optional)

You may optionally include an SSH key as part of the integration, and the pipelines you create through Azure DevOps integration will use the SSH protocol to access repositories as opposed to the default HTTPS protocol which will be used if an SSH key is not specified. SSH keys are restricted to a single organisation and cannot access multiple organisations, unlike Personal access tokens.

Generate an SSH-RSA Key

These commands are identical for both Windows and Linux.

  1. Open a terminal in Linux or Powershell in Windows.

  2. Input the command below:

    ssh-keygen -t rsa
  1. You will be prompted to enter a location to save the key. Press Enter to accept the default location which is shown.
  2. When prompted, enter a secure passphrase.
  3. Now two files will have been generated, and you can browse to the location where you saved them. The file ending in .pub contains the public key which will need to be added to your Azure DevOps organisation.

Add the SSH key to your Azure DevOps Organisation

  1. Switch to the correct organisation for which you want to create the token by going to the Azure Devops homepage (click the Azure DevOps logo on the top left) and select the correct organisation form the left-hand column.

  2. Click the User Settings button on the top right hand corner of the screen and select SSH public keys.

  3. Click the New Key button.

  4. Choose a name for the key that helps to remember what it is for, and paste the public key from the file you generated earlier.

    The public key will be similar to:

    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABRIit/S93UY9M8= user@example.com

  5. Click Add to save the key in Azure DevOps.

Now that you have created the token (and optional SSH key), it is time to link your Azure DevOps organisation to BeetleboxCI.

  1. Click on your profile on the right hand side of the BeetleboxCI webapp and select the Settings button.
  2. In the Settings tab select Linked Organisations and then the Azure tab. Under Azure Integration Settings, fill in the following information:
    • Authorization URL - `https://dev.azure.com/<organisation_name>``
    • API version - 7.1 (BeetleboxCI currently used Azure DevOps API version 7.1)
    • Beetlebox URL - the URL of your Beetlebox app, e,g. http://192.168.1.10:32767.
    • Organization/Collection - The name of the Azure organization that you selected.
    • Username - This is the same as the Azure DevOps organization, for Azure DevOps services.
    • Personal access token - Paste in the personal access token that you created earlier.
    • Private SSH key (optional) - Paste in the private key that you optionally created earlier.
  1. Once finished, select Update Azure Data.

Manually Adding a Public Azure Repository to BeetleboxCI

  1. On the pipelines page of BeetleboxCI in your browser: If you do not already have any pipelines in BeetleboxCI, click 'Create your first pipeline'. Otherwise, click "Create Pipeline" at the bottom of the pipelines page.
  2. In the following screen, fill in the following:
  • Project Name: [Name of your repository]

  • Repository URL: https://dev.azure.com/<organisation_name>/<public_project_name>/_git/<public_repository_name>

    The authentication settings can be left blank since they are not necessary when adding a public repository.

  1. Click proceed. You will now be redirected to the pipelines page where you can see the pipeline that you just created.

Manually Adding a Private Azure Repository to BeetleboxCI

When you add a private repository to BeetleboxCI, you will need to provide either:

  • An SSH key (refer to the Create an SSH Key section above)
  • A username and token for HTTPS authentication (refer to Create a Personal Access Token above)

The steps are as follows:

  1. On the pipelines page of BeetleboxCI in your browser: If you do not already have any pipelines in BeetleboxCI, click 'Create your first pipeline'. Otherwise, click "Create Pipeline" at the bottom of the pipelines page.
  2. In the following screen, fill in the following:
  • Project Name: [Name of your repository]
  • Repository URL: https://dev.azure.com/<organisation_name>/<project_name>/_git/<repository_name> or git@ssh.dev.azure.com:v3/<organisation_name>/<project_name>/<repository_name>
  1. Also fill in either the "Authentication settings" section OR the "SSH Authentication" section. You will need need to use username and token authentication if you chose the HTTPS URL or SSH authentication if you chose the SSH URL.
  • Authentication Settings — Username: <organisation_name> or <generated_username>
  • Authentication Settings — Password: <personal_access_token> or <generated_password>
  • SSH Authentication — SSH private key
  1. Click proceed. You will now be redirected to the pipelines page where you can see the project that you just created.