DEV Community

Cover image for GitHub + Dev Hackathon 2023 - Self-hosted Azure Pipelines Agent Codespace/Dev Container
Marcel.L
Marcel.L

Posted on • Edited on

5 2

GitHub + Dev Hackathon 2023 - Self-hosted Azure Pipelines Agent Codespace/Dev Container

What I built

Created a community Codespace that has an Azure Pipelines agent built into the Codespace. The Codespace can register itself via Codepsace Secrets as a self-hosted Azure pipelines agent into an Azure DevOps Agent pool, and be used to run Azure pipelines using the compute power of the Codespace.

image.png

Category Submission

👷 DIY Deployments 👷

App Link

https://containers.dev/templates

Template Name Maintainer
Azure Pipelines Agent Marcel Lupo @Pwd9000-ML

Screenshots

  • Add Codespace secrets on the GitHub repository where the Codespace is to be spun up

image.png

  • Select Add Dev Container Configuration Files...

image.png

  • Select Create a new configuration...

image.png

  • Select Show All Definitions...

image.png

  • Select Azure Pipelines Agent

image.png

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

image.png

Description

Use and utelise your codespace compute power to also run a self hosted azure pipelines agent. This devcontainer can be used as a codespace that will create and attach a self-hosted azure pipelines agent inside of the codespace and attach/register the ADO agent with an Azure DevOps agent pool by using secrets for codespaces as parameter values:

image.png

Link to Source Code

https://github.com/Pwd9000-ML/devcontainer-templates/tree/main/src/azure-pipelines-agent-devcontainer

Permissive License

MIT LICENSE

Background (What made you decide to build this particular app? What inspired you?)

Wanted to create a way to be able to build as well as test my Azure Pipelines (CI/CD) processes, but not have the hassle and costs of building a separate self hosted agent. To instead utilise the same Codespace I'm already working in to also use as my Azure Pipelines agent.

How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?)

Learned how to create community Codepsaces to contribute to the wider Dev community and I hope that many others will find my Codespace useful and also contribute to making it even better.

Video Tutorial - How to use

Author

Like, share, follow me on: 🐙 GitHub | 🐧 X/Twitter | 👾 LinkedIn

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay