Run self-hosted Azure Pipelines Agent on GitHub Codespaces (Video Tutorial)
Tags: github, codespaces, devcontainers, azurepipelines
Published: 2023-05-07 18:13:32

---
title: Run self-hosted Azure Pipelines Agent on GitHub Codespaces (Video Tutorial)
published: true
description: A quick video tutorial to get you started on running your self-hosted Azure Pipelines Agent inside of your GitHub Codespaces.
tags: 'github, codespaces, devcontainers, azurepipelines'
cover_image: 'https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/main01.png'
canonical_url: null
id: 1460516
series: GitHub Codespaces Pro Tips
date: '2023-05-07T18:13:32Z'
---

## Overview

Based on a [previous blog post](https://dev.to/pwd9000/hosting-azure-devops-pipelines-agents-on-github-codespaces-4jm2), this devcontainer is now publicly available as a template for anyone to use at [Dev Container Templates](https://containers.dev/templates) and integrated with publicly available Codespace images.

Check out the [repo and documentation](https://github.com/Pwd9000-ML/devcontainer-templates/tree/main/src/azure-pipelines-agent-devcontainer).

## Video Tutorial

{% youtube XTc7bphBox8 %}

## How to add this community Codespace config

- Add [Codespace secrets](https://docs.github.com/en/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces?wt.mc_id=DT-MVP-5004771) on the GitHub repository where the Codespace is to be spun up

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-Dev-Hackathon-2023/assets/sec02.png)

- Select `Add Dev Container Configuration Files...`

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add01.png)

- Select `Create a new configuration...`

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add02.png)

- Select `Show All Definitions...`

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add03.png)

- Select `Azure Pipelines Agent`

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add04.png)

- Select Debian version `bullseye`

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add05.png)

- Choose version of ADO Agent to install inside of Codespace

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add06.png)

- Select any additional features to install (example, Terraform)

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add07.png)

- Notice `.devcontainer` now holds Codespace configuration

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add08.png)

**NOTE:** The config is the same template as found on this public Dev Container [.src/azure-pipelines-agent-devcontainer/.devcontainer](https://github.com/Pwd9000-ML/devcontainer-templates/tree/main/src/azure-pipelines-agent-devcontainer/.devcontainer)

- Commit and sync Dev Container Configuration

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add09.png)

- Launch new codespace with options

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add10.png)

- Select options, compute size and Create new Codespace

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2023/GitHub-ADO-Codespace-video/assets/add11.png)

Self hosted Azure Pipelines agent registers on agent pool and runs inside Codespace at launch

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2022/GitHub-Codespaces-DevOps-Agent/assets/run06.png)

Submitted as part of the **GitHub + DEV Hackathon 2023**

![image.png](https://raw.githubusercontent.com/Pwd9000-ML/devcontainer-templates/main/assets/GitHubHack23.png)

### _Author_

Like, share, follow me on: :octopus: [GitHub](https://github.com/Pwd9000-ML) | :penguin: [Twitter](https://twitter.com/pwd9000) | :space_invader: [LinkedIn](https://www.linkedin.com/in/marcel-l-61b0a96b/)

{% user pwd9000 %}

<a href="https://www.buymeacoffee.com/pwd9000"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=pwd9000&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff"></a>