Editar

Compartir a través de


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

Follow these steps to create and configure the cache rule that will be used to pull artifacts from the repository into your cache.

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.

    Screenshot showing the Cache option in the service menu of a container registry in the Azure portal.

  3. Select Create rule.

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

  4. A window for New cache rule appears.

    Screenshot for new Cache Rule in Azure portal.

  5. Enter the Rule name.

  6. Select Source Registry from the dropdown menu.

  7. Enter the Repository Path to the artifacts you want to cache.

  8. Depending on your source, Authentication may 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.
  9. For Destination, enter the name of the New ACR repository namespace to store cached artifacts.

    Screenshot showing cache rule creation for a container registry in Azure portal.

  10. Select Save.

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 the Cache pane, select Credentials, then select Create credentials.

    Screenshot for adding credentials in Azure portal. code language="{language}" source="{source}" range="{range}":::

    Screenshot for create new credentials 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.

Next steps