-
create PAT token as described here https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops#authenticate-with-a-personal-access-token-pat and securely note it down
-
create Agent Pool in your ADO project and note down its name
- 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
andaz acr repository show-tags --name $ACR_URL --repository adoagent
- image build logs can be checked with
- 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 if containers are provisioned with
- Check status of agents in a pool of your ADO project (
https://dev.azure.com/<YourADOorganization>/<YourADOproject>/_settings/agentqueues
)
An update of ADO agents image is done is two steps:
-
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). -
Updating the agents pool with new image version is done by redeploying ACA (see command in the section above).