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
- An existing ACR instance. If you don't already have one, use our quickstart to create a new container registry.
- An existing Key Vault to create and store credentials.
- Permissions to set and retrieve secrets from your Key Vault.
- Azure CLI. You can use the Azure Cloud Shell or a local installation of the Azure CLI to run the commands in this article. If you'd like to use it locally, Azure CLI version 2.46.0 or later is required. To confirm your Azure CLI version, run
az --version
. To install or upgrade, see Install Azure CLI.
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.
Navigate to your Azure Container Registry instance.
In the service menu, under Services, select Cache.
Select Create rule.
A window for New cache rule appears.
Enter the Rule name.
Select Source Registry from the dropdown menu.
Enter the Repository Path to the artifacts you want to cache.
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.
For Destination, enter the name of the New ACR repository namespace to store cached artifacts.
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..
In the Cache pane, select Credentials, then select Create credentials.
code language="{language}" source="{source}" range="{range}":::
Enter a Name for the new credentials for your source registry.
Select a Source Authentication. Artifact cache currently supports Select from Key Vault and Enter secret URIs.
For the Select from Key Vault option, create your credentials using Key Vault.
Select Create.
Next steps
- Learn about troubleshooting issues with artifact caching (troubleshoot-artifact-cache.md).
- Learn how to enable artifact cache using the Azure CLI.