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.
- 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.
- Click the
User Settings
button on the top right hand corner of the screen and selectPersonal access tokens
. - Click the
New Token
button. - Choose a suitable name that allows you to identify the token and an expiration time.
- 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.
- Scroll down to
Scopes
, ensure that underCode
, theRead & write
andStatus
options are selected, and then clickCreate
. - 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)
- Browse to an Azure DevOps repository in an Azure DevOps project at
https://dev.azure.com/<organisation_name>/_git/<project_name>
- Press the
Clone
button. - Click
Generate Git Credentials
. This will generate a username and password which you can use to access your repositories. - Save these credentials in a secure place as you will not be able to see them again.
- 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 selectPersonal access tokens
. - Select the token you just created and click
Edit
. - Scroll down to
Scopes
, ensure that underCode
, theRead & write
andStatus
options are selected, and clickSave
.
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.
Open a terminal in Linux or Powershell in Windows.
Input the command below:
ssh-keygen -t rsa
- You will be prompted to enter a location to save the key. Press Enter to accept the default location which is shown.
- When prompted, enter a secure passphrase.
- 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
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.
Click the
User Settings
button on the top right hand corner of the screen and selectSSH public keys
.Click the
New Key
button.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
Click
Add
to save the key in Azure DevOps.
Link your Azure DevOps Organisation to BeetleboxCI
Now that you have created the token (and optional SSH key), it is time to link your Azure DevOps organisation to BeetleboxCI.
- Click on your profile on the right hand side of the BeetleboxCI webapp and select the
Settings
button. - In the
Settings
tab selectLinked Organisations
and then theAzure
tab. UnderAzure 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.
- Once finished, select
Update Azure Data
.
Manually Adding a Public Azure Repository to BeetleboxCI
- 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.
- 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.
- 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:
- 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.
- 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>
orgit@ssh.dev.azure.com:v3/<organisation_name>/<project_name>/<repository_name>
- 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
- Click proceed. You will now be redirected to the pipelines page where you can see the project that you just created.