Skip to content

Self Hosted

github-actions edited this page Mar 14, 2023 · 4 revisions

Self-hosted agents/runners

The AzOps pipelines/actions are running on Microsoft-hosted agents or GitHub Actions hosted virtual environments by default. Depending on your organizations security requirements you might want to use self-hosted agents/runners instead. The benefits of using self-hosted agents are:

  • Possibility to use a Managed Identity instead of Service Principal
  • Performance advantages - start and run builds faster
  • Runtime isolation - no shared compute
  • Possibility to deploy to internal resources using private endpoints
  • Full control over network traffic

AzOps have full support for the use of self-hosted agents/runners and this article outlines the requirements needed.

For more information about using GitHub Actions self-hosted runners see, About self-hosted runners. For more information about using Azure DevOps self-hosted agents see, Azure Pipelines agents.

⚠️ In case of multiple agents/runners on the same compute resource ensure locking the Validate and Push pipelines to the same the agent/runner (e.g. using demands with Azure Pipelines)

Virtual Machine Scale Sets (VMSS)

Virtual Machine Scale Sets are optimal for hosting your self-hosted agents/runners. They are easy to create and manage and will automatically scale as resource demand changes. To learn more about Virtual Machine Scale Sets see, Virtual Machine Scale Sets documentation.

Image

To setup a VMSS for your self-hosted agents/runners you need an image with all the required software installed. The pipelines and actions provided in the AzOps-Accelerator repository are using the GitHub Actions Virtual Environments ubuntu-latest image by default. The images includes multiple tools and software including all AzOps requirements.

Build an image using GitHub Actions Virtual Environments

If you want to use the same image as the hosted environments for your self-hosted agents/runners you can build an image following the guides in the GitHub Actions Virtual Environments.

Building your own custom image

If you want to build your own custom lightweight image the following software is required for AzOps to function properly.

Required software

AzOps have a couple of dependencies that are required to function properly. When building your custom image, make sure that the following tools are included in the image:

Software Note
jq Minimum required version is 1.6
Git -
PowerShell Minimum required version is 7.2
Azure CLI Required when using Azure DevOps
Github CLI Required when using GitHub
Bicep Required if you plan to deploy Bicep templates using AzOps
PowerShell Modules

AzOps depends on some of the Az modules and PSFramework, these modules will be installed with AzOps during pipeline/action run and are not required to include in your image. But if you want to make your pipelines/actions as fast as possible the modules can be included in your image. To find the modules and the version required for the latest AzOps version see the module manifest.

Azure CLI Extensions

AzOps are using the az repos command group which is a part of the azure-devops extension to manage pull requests. The extension should be included in the image if running AzOps on Azure DevOps.

Extension
azure-devops