dockerazure-devops

How to mount an Azure file share in an Azure DevOps container job?


We need to persist the files that are generated or updated when running a container job in Azure DevOps.

resources:
  containers:
  - container: cicd
    image: XYZ.azurecr.io/dashboards-amd64:0.1
    endpoint: acr_service_connection
    options: --user 0:0
      
jobs:

- job: Build
  pool:
    name: Databricks

  container: cicd

<snip>

What is the correct way of achieving this?

Is it possible to do the mounting directly by using the volumes property:

 volumes: [ string ] # Volumes to mount on the container.

or can you pass in a flag to the options property

options: string # Options to pass into container host.

Solution

  • It turns out that you can use an Azure Container Apps Jobs with a mounted volume to run the Azure DevOps pipeline.

    https://learn.microsoft.com/en-us/azure/container-apps/tutorial-ci-cd-runners-jobs?pivots=container-apps-jobs-self-hosted-ci-cd-azure-pipelines&tabs=bash