Giter Site home page Giter Site logo

ado-aca's Introduction

Hosting Azure DevOps agents in Container Apps

Preparation

Initial Deployment

  • login to Azure az login in your shell (Azure shell is the easiest way)
  • checkout this/forked repo (e.g. git clone https://github.com/antsok/ado-aca.git) and cd to ado-aca dir
  • (if needed) change the subscription context with az account set -n '<subscription name>'
  • set resource group name with RG_NAME=<resource group name>
  • create resource group az group create -l 'westeurope' -n $RG_NAME
  • deploy ACR and build the image by running ACR_URL=$(az deployment group create --resource-group $RG_NAME --template-file src/infra/acr.bicep --query "properties.outputs.acrLoginServer.value" -o tsv) and waiting for it to finish
    • image build logs can be checked with az acr taskrun logs --name adoagent-taskrun --resource-group $RG_NAME --registry $ACR_URL
    • image can be checked with az acr repository show --name $ACR_URL --repository adoagent and az acr repository show-tags --name $ACR_URL --repository adoagent
  • run az deployment group create --resource-group $RG_NAME --template-file src/infra/aca.bicep --parameters azpUrl=https://dev.azure.com/<YourADOorganization> azpPool=<Agent-Pool-Name> azpToken=<PAT Token> containerCount=<number of agents>
    • check if containers are provisioned with az containerapp show -n ado-agents-ca -g $RG_NAME
    • logs can be viewed with az containerapp logs show -n ado-agents-ca -g $RG_NAME --follow true
  • Check status of agents in a pool of your ADO project (https://dev.azure.com/<YourADOorganization>/<YourADOproject>/_settings/agentqueues)

Update

An update of ADO agents image is done is two steps:

  1. Updating the image in the ACR, which can be triggered with az acr task run --name adoagent-task --registry $ACR_URL OR by redeploying the ACR (see the command in the "Initial Deployment" section above).

  2. Updating the agents pool with new image version is done by redeploying ACA (see command in the section above).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.