Benefits of using a self-hosted agent (besides using standard Azure DevOps pipeline tasks and oci scripting):
- Allows running
oci cli
scripting asinstance principal
that enables authentication and authorization via OCIpolicies
without storing credentials on Azure DevOps side - Enables caching e.g. container images caching for fast builds
Deploy Azure Devops Agent creation stack to OCI Resource Manager (Terraform) using the button below.
Stack then allows to configure the agent parameters for the Agent and VM creation:
- Agent and VM name
- Azure DevOps organization url
- Azure DevOps PAT
- Agent pool name (default is 'Default')
- VM shape (OCPUs, memory and boot volume disk size)
You can delete the created resources at any time using stack destroy
and re-create them again using the stack apply
. Before re-creating it is advisable to remove the exisiting agent from the Azure DevOps agent pool. Multiple
agents can be set up by changing the default name AzureDevOpsagent
of individual agents to something unique.
Terraform provider oracle/oci
is installed so the created agent can be also used for Terraform pipelines including https://marketplace.visualstudio.com/items?itemName=ms-devlabs.custom-terraform-tasks
Terraform takes a moment to complete and eventually the build agent should appear in Azure DevOps agent pool.
VM boot volume size is 200M by default that can be adjusted per build needs during the Terraform stack creation.
A bigger VM shape performs better. The defaults are 1 OCPU and 8GB memory that can be also adjusted during the Terraform stack creation.