// Why this matters
A dvc remote azure blob setup solves a specific reproducibility problem: models are trained on data that changes, and weeks later nobody can say which version produced which result. DVC records content hashes in small files that go into Git, so a commit identifies both code and data. The data itself needs a home that is durable, cheap and access-controlled, which is an infrastructure problem.
Orchestration is the other half. Data preparation, training and evaluation are pipelines with dependencies, retries and schedules. Airflow is a common answer; running it yourself means upgrades, scaling and a metadata database to look after. A managed service such as Astronomer moves that burden, and the platform team's job becomes provisioning deployments consistently and wiring them to storage and identity.
Both pieces need to be repeatable for many teams across subscriptions. The pattern below treats a team as a record and produces storage, access and an Airflow deployment from it, the same shape used elsewhere in this platform, for instance From Form to Running Cluster: Self-Service Team Onboarding.
// The problem
The default DVC setup points at a storage account with an account key in a local config file. That key is shared by everyone, is rarely rotated and grants access to every dataset in the account. Anyone who clones the repository and runs dvc pull is using a credential whose owner cannot be identified.
Storage cost behaves badly under ML workloads: every experiment can write multi-gigabyte artefacts, nobody deletes them and old versions pile up. Without lifecycle rules, the bill grows monotonically, and without per-team containers it cannot be attributed.
On the orchestration side, teams that self-manage Airflow end up with different versions, different executors and credentials stored in Airflow connections, which turn the scheduler into a credential vault nobody planned to secure.
// The solution
Storage is one account per environment, private and with shared key access disabled, with a container per team. Each container gets a lifecycle policy (move cold data to a cooler tier, expire temporary prefixes) and role assignments for the team's group (data contributor) and for the Airflow workload identity. Blob versioning and soft delete protect against accidental overwrites, which matters because dvc push is content-addressed but humans still delete things.
DVC is configured to use Azure authentication through the default credential chain. The remote URL and account name are committed in .dvc/config; the credentials are never in the repository. Developers authenticate with az login and DVC picks up the token through the Azure SDK; Airflow tasks use a workload identity, so the same remote works in both places with no key.
Astronomer deployments are provisioned through the Astronomer Terraform provider: a workspace per team and a deployment per environment, with explicit executor, worker queue and resource settings. Pinning the runtime version in code means upgrades are reviewed changes. DAG code is delivered by CI using an API token stored as a CI secret, building an image and deploying it to the target deployment.
We rejected a shared container with folder conventions (no isolation, no attribution), account keys in Airflow connections (a credential store in the scheduler) and self-hosted Airflow on Kubernetes for these teams (more control than they needed and a lot more to operate). For teams that do want in-cluster orchestration, the same storage pattern applies. Governance of the models consuming this data is covered in Azure AI Foundry Onboarding: Governed ML Workspaces for Teams with Terraform, and the CI pattern follows One Reusable Plan/Apply Workflow for Cost-Optimised Autoscaling.
- Requestteam, environments, storage size class
- Storage accountprivate, versioned, no shared keys
- Container per teamlifecycle rules and RBAC
- DVC remoteconfiguration committed, credentials not
- Astronomer workspacedeployments per environment
- Gate: apply approval gatereviewer sees capacity and access
- Workload identityAirflow tasks reach storage keylessly
- DAG deployCI pushes DAG image to the deployment
- Pipeline rundvc pull, process, dvc push
// Before you start
- An Azure subscription and permission to create storage accounts and role assignments.
- Terraform 1.5+ with
azurermand theastronomer/astroprovider, plus an Astronomer organisation API token. - Python 3.10+, DVC with the Azure extra (
pip install "dvc[azure]"), and the Astro CLI for local DAG tests. - Entra groups for each team and an Azure workload identity (federated) for Airflow tasks.
- A Git repository per ML project with a CI system that can reach Astronomer.
- Awareness of how much data teams produce, to size lifecycle rules.
// Step-by-step implementation
01 Provision the storage account and per-team containers
The account is private, versioned and keyless. Containers are created from a team map; adding a team is an addition to a variable. Disable shared key access from the start; retrofitting it later breaks every tool that quietly used the key.
Use zone-redundant replication unless you can recreate the data cheaply from source.
02 Add lifecycle rules so cost stays bounded
Experiment output is write-heavy and rarely read twice. Move blobs to a cooler tier after a period of no access and expire clearly temporary prefixes. Keep the DVC cache prefix longer-lived, because deleting an object a
.dvcfile points to breaks reproduction.Make the numbers variables and revisit them with real access data.
03 Configure DVC to use keyless access
Initialise DVC in the project and add the Azure remote by account and container. Credentials are not stored: DVC's Azure backend uses the default Azure credential chain, so developers use
az loginand automated jobs use a workload identity.Commit
.dvc/configand the.dvcpointer files. Add a local-only config for per-user options if needed; it stays out of Git.04 Define a reproducible pipeline
A
dvc.yamldescribes stages with inputs, outputs and parameters. DVC hashes everything, sodvc reproonly reruns what changed, anddvc pushuploads only new objects. The same file is what the Airflow task will run, so there is one definition of the pipeline.Keep parameters in
params.yamlso experiments differ by a committed file.05 Create the Astronomer workspace and deployments
The Astronomer Terraform provider manages workspaces and deployments. Declare one workspace per team and a deployment per environment, with the runtime version pinned. Worker queue sizing is explicit so cost is a reviewed number.
Resource names and field names change between provider releases; check the provider documentation for your version.
06 Give Airflow tasks keyless access to storage
Airflow tasks should authenticate to Azure with a workload identity rather than a connection holding a key. Create a user-assigned identity with a federated credential for the deployment's workload, give it the blob role on the team container and configure the task environment to use it.
The same DVC remote definition then works in a task:
dvc pullanddvc pushuse the default credential chain.07 Write the DAG and deploy it from CI
The DAG runs the pipeline rather than reimplementing it: check out the repository,
dvc pull,dvc repro,dvc push. UsingBashOperatororKubernetesPodOperatorkeeps the task identical to a developer's laptop run, which is the point of the whole exercise.CI builds the project image and deploys it to the right deployment with the Astro CLI, using a deployment-scoped API token held as a CI secret.
// How to verify it works
az storage account show -n <account> --query allowSharedKeyAccessreturnsfalse, anddvc pushstill works afteraz login.dvc status -creports "Cache and remote are in sync" after a push.- A user outside the team group gets an authorisation error on
dvc pullfor that container. - The Astronomer deployment shows the pinned runtime version and the DAG appears after a CI deploy.
- A DAG run completes all three tasks and the new objects appear in the container; no storage key exists in Airflow connections.
// Design decisions and trade-offs
- A dedicated storage account per environment with one container per team, rather than one container for everyone.
- DVC remotes authenticate with Entra identities and short-lived tokens, not account keys.
- Astronomer deployments are created by Terraform per team and environment with explicit worker sizing.
- Airflow reaches storage through a workload identity, not a connection holding a stored key.
- DAGs and DVC metadata live in Git; large artefacts live in object storage. Git stays small.
// Pitfalls and lessons learned
- Disabling shared keys breaks any tool that defaults to them; test
dvcand your SDK versions against a keyless account before rolling out. - Lifecycle rules that expire objects referenced by
.dvcfiles break reproducibility; scope deletion to temporary prefixes only. - DVC remote over a private endpoint needs DNS that resolves the private address from wherever the job runs, including inside the managed orchestrator network.
- Large
dvc pushruns hit throttling; tunejobsand keep one remote per project instead of one giant shared one. - Astronomer provider arguments change between versions; pin the provider and read changelogs before upgrading.
- Federated identity subjects for managed orchestrators are not always documented clearly; confirm the issuer and subject from a failed token exchange log.
- Committing a
.dvc/config.localwith credentials is the most common leak; add it to.gitignoreand scan for it in CI.
// Frequently asked questions
How do I set up a DVC remote on Azure Blob Storage?
Create a private container, run dvc remote add -d storage azure://<container>/<path>, set the account name and authenticate with az login or a managed identity instead of a key.
Can Terraform manage Astronomer deployments?
Yes, the Astronomer Terraform provider manages workspaces and deployments, including runtime version and worker queues.
Where should DVC credentials live?
Nowhere in the repository; use the Azure credential chain locally and a workload identity in automated jobs.
How do I stop ML storage costs growing forever?
Use lifecycle rules to tier cold data and expire temporary prefixes, with a container per team for attribution.
Why run dvc inside Airflow tasks?
It keeps the pipeline definition in one place so the scheduled run and a developer run execute the same stages.
// The outcome
ML and data teams get versioned datasets and a managed orchestrator from the same declarative request, with access scoped by team and no shared keys. Experiments are reproducible because code, data version and pipeline definition travel together.
// Where to take it next
- Add data quality checks as DVC stages that fail the pipeline on bad inputs.
- Register trained models in a model registry and connect to Azure AI Foundry Onboarding: Governed ML Workspaces for Teams with Terraform.
- Use the GCP equivalents (Composer, Pub/Sub, BigQuery) described in GCP Landing Zone with a Terraform Module Library: Folders, Projects and Org Policy.
- Add cost dashboards by team using the container-per-team layout.