Enable Artifact Cache with authentication - Azure portal

This article is part four of a six-part tutorial series. Part one provides an overview of Artifact Cache, its features, benefits, and limitations. In part two, you learn how to enable Artifact Cache feature by using the Azure portal. In part three , you learn how to enable Artifact Cache feature by using the Azure CLI.

This article walks you through the steps of enabling Artifact Cache with authentication by using the Azure portal. You have to use the Credential set to make an authenticated pull or to access a private repository.


Configure Artifact Cache with authentication - Azure portal

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

  1. Navigate to your Azure Container Registry.

  2. In the side Menu, under the Services, select Cache .

    Screenshot for Registry cache.

  3. Select Create Rule.

    Screenshot for Create Rule.

  4. A window for New cache rule appears.

    Screenshot for new Cache Rule.

  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. For adding authentication to the repository, check the Authentication box.

  9. Choose Create new credentials to create a new set of credentials to store the username and password for your source registry. Learn how to create new credentials

  10. If you have the credentials ready, Select credentials from the drop-down menu.

  11. Under the Destination, Enter the name of the New ACR Repository Namespace to store cached artifacts.

    Screenshot to save Cache Rule.

  12. Select on Save

  13. Pull the image from your cache using the Docker command by the registry login server name, repository name, and its desired tag.

    • For example, to pull the image from the repository hello-world with its desired tag latest for a given registry login server myregistry.azurecr.io.
     docker pull myregistry.azurecr.io/hello-world:latest

Create new Credentials

Before configuring the Credentials, you require to create and store secrets in the Azure KeyVault and retrieve the secrets from the Key Vault. Learn more about creating and storing credentials in a Key Vault. and to set and retrieve a secret from Key Vault..

  1. Navigate to Credentials > Create credentials.

    Screenshot for adding credentials.

    Screenshot for create new credentials.

  2. Enter 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 URI's.

  4. For the Select from Key Vault option, Learn more about creating credentials using key vault.

  5. Select on Create

Next steps

  • Advance to the next article to enable the Artifact Cache using Azure CLI.