azure

Azure cloud deployment and configuration scripts.

Use it on boxctl

  1. On the dashboard, pick azure in the Template picker and click Boot box.
  2. The box boots, then runs azure/agent-pool.sh on itself. The button reads Booting… until the script has finished.
  3. Open the box's Terminal and follow the guide below. The box's row keeps a link back to this page under the template's name.

The guide is shared with the onctl CLI, so it starts from an onctl up -a azure/agent-pool.sh command. Booting a box with this template replaces that command; everything the guide runs on the VM itself applies as written.

Options

This template needs TOKEN, URL and AGENT_POOL_NAME, and boxctl cannot pass options to a template yet. Booted from the dashboard, its script runs without them.

OptionRequiredWhat it sets
TOKENYesAzure DevOps personal access token.
URLYesAzure DevOps organization URL, e.g. https://dev.azure.com/<org>.
AGENT_POOL_NAMEYesAgent pool to register into.
AGENT_NAMENoAgent name (default: hostname).

Azure DevOps self-hosted Agents

Ref: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=yaml%2Cbrowser#self-hosted-agents

using .env file

  • Create a dot-env file. copy .env.example to ".env.test" and fill in your variables:
    TOKEN=<Yout_PAT_token>
    AGENT_POOL_NAME=<POOL_NAME>
    URL=https://dev.azure.com/<ORG_NAME>
    
  • Run onctl command with --dot-env parameter.
    onctl up -n agent1 -a azure/agent-pool.sh --dot-env .env.test
    

parameters in command line

onctl up -n agent1 -a azure/agent-pool.sh -e TOKEN=<Yout_PAT_token> -e AGENT_NAME=<unique_name> -e AGENT_POOL_NAME=<POOL_NAME> -e URL=https://dev.azure.com/<ORG_NAME>

See the template's source for exactly what it runs.