Skip to content

Azure paths

Azure needs three path-shaped values rather than two: a registry login server, a registry resource ID, and a blob path.

The registry path

<registry>.azurecr.io/<repository>
--artifact-registry <acr-name>.azurecr.io/<repository>

This is the login server, used for pushing and pulling and for deriving the runtime image:

runtime:
  image: <acr-name>.azurecr.io/<repository>/xratu-data-plane:latest

The registry scope

/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ContainerRegistry/registries/<registry>
--artifact-registry-scope /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ContainerRegistry/registries/<acr-name>

This is the resource ID the AcrPush role is assigned on:

resource "azurerm_role_assignment" "runtime_acr_push" {
  scope                = "/subscriptions/.../registries/<acr-name>"
  role_definition_name = "AcrPush"
  principal_id         = azurerm_user_assigned_identity.runtime.principal_id
}

Azure needs both forms because a role is assigned on a resource ID while an image is pushed to a login server, and neither is derivable from the other. Get it with:

az acr show -g <resource-group> -n <acr-name> --query id -o tsv

The bucket

azblob://<account>/<container>/<prefix>
--artifact-bucket azblob://<storage-account>/<container>/<prefix>

Three segments rather than the two the other clouds take, because a blob path names a storage account and a container separately.

The account and container are composed into the scope for the blob role assignment:

  scope = "/subscriptions/.../providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>"

So the grant is container-scoped. The prefix organises objects within it.

A path missing any segment is refused:

artifact_bucket.path must be a supported full bucket path
(gcs://<bucket>/<prefix>, s3://<bucket>/<prefix>, azblob://<account>/<container>/<prefix>)

The scheme must match the provider

artifact_bucket.path scheme must match provider (gcp=gcs://, aws=s3://, azure=azblob://)

All of them must already exist

The registry, the storage account and the container are yours. Terraform creates identities and assigns roles on them.

az acr show -g <resource-group> -n <acr-name> --query loginServer -o tsv
az storage container show --account-name <storage-account> --name <container>

A role assignment whose scope names something absent fails at terraform apply, which is where a wrong scope surfaces.

Adding them to the bundle's own terraform/main.tf is possible and is a poor place to own them, for reasons covered in Registry and bucket schemes.

On a private network

provider_config:
  azure_authority_host: https://login.microsoftonline.com/

Set this where the node reaches Entra through a private or sovereign endpoint. See Air-gapped deployment.