Edit

Share via


Enable artifact cache in your Azure Container Registry with Azure portal

In this article, you learn how to use the Azure portal to enable the artifact cache feature in your Azure Container Registry (ACR).

In addition to the prerequisites listed here, you need an Azure account with an active subscription. Create an account for free.

Prerequisites

Configure Artifact cache

To create and configure the cache rule that pulls artifacts from the repository into your cache, follow these steps.

Follow the steps to create a cache rule in the Azure portal.

  1. Navigate to your Azure Container Registry instance.

  2. In the service menu, under Services, select Cache.

  3. Select Create rule.

    Screenshot showing the Create rule command for a container registry in the Azure portal.

  4. In the New cache rule pane, enter a Rule name.

  5. For Source, select a login server.

  6. For Repository Path, enter the full repository path to the artifacts you want to cache.

  7. Depending on your source, Authentication might be required. If the Authentication box isn't already checked, and you don't want to use authentication, you can skip this section. Otherwise, ensure the box is checked and add your credentials:

    • Select Create new credentials to create a new set of credentials to store the username and password for your source registry. For more information, see create new credentials.
    • To use existing credentials, choose Select credentials from the drop-down menu.
  8. For Destination, enter the name of the New ACR repository namespace to store cached artifacts.

  9. Select Create to create your cache rule.

    Screenshot showing details entered to create a new cache rule for a container registry in the Azure portal.

Create new credentials

Before configuring the credentials, make sure you're able to create and store secrets in the Azure Key Vault and retrieve secrets from the Key Vault.

  1. In your container registry's Cache pane, select Credentials, then select Create credentials.

    Screenshot of the steps to start adding credentials for a container registry in Azure portal.

  2. Enter a Name for the new credentials for your source registry.

  3. Select a Source Authentication. Artifact cache currently supports Select from Key Vault and Enter secret URIs.

  4. For the Select from Key Vault option, create your credentials using Key Vault.

  5. Select Create.

    Screenshot showing details entered to create credentials for a container registry in Azure portal.

Alternately, you can use Azure RBAC to assign the Key Vault Secrets User role (or a custom role that includes the Microsoft.KeyVault/vaults/secrets/getSecret/action permission) to the system identity. For more information, see Assign Azure roles using the Azure portal and Grant permission to applications to access an Azure Key Vault using Azure RBAC.

Next steps

Note: The author created this article with assistance from AI. Learn more