Skip to content

Commit 21d10e5

Browse files
committed
edit
1 parent 7040a21 commit 21d10e5

File tree

7 files changed

+252
-2
lines changed

7 files changed

+252
-2
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,6 +4959,11 @@
49594959
"source_path_from_root": "/articles/virtual-network/ip-services/routing-preference-cli.md",
49604960
"redirect_url": "/azure/virtual-network/ip-services/routing-preference-portal",
49614961
"redirect_document_id": false
4962+
},
4963+
{
4964+
"source_path_from_root":"/articles/container-registry/manual-regional-move.md",
4965+
"redirect_url":"/azure/operational-excellence/relocation-container-registry",
4966+
"redirect_document_id":false
49624967
}
49634968

49644969
]

articles/container-registry/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
href: container-registry-retention-policy.md
133133
- name: Automatically purge tags and manifests (preview)
134134
href: container-registry-auto-purge.md
135+
- name: Relocate to another region
136+
href: ../operational-excellence/relocation-container-registry.md?toc=/azure/container-registry/toc.json
135137
- name: Use ACR webhooks
136138
href: container-registry-webhook.md
137139
- name: Move registry to different region

articles/operational-excellence/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
- name: Azure Cache for Redis
4646
href: ../azure-cache-for-redis/cache-moving-resources.md?toc=/azure/operational-excellence/toc.json
4747
- name: Azure Container Registry
48-
href: ../container-registry/manual-regional-move.md?toc=/azure/operational-excellence/toc.json
48+
href: relocation-container-registry.md
4949
- name: Azure Cosmos DB
5050
href: relocation-cosmos-db.md
5151
- name: Azure Database for MariaDB Server
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
author: anaharris-ms
3+
ms.service: container-registry
4+
ms.topic: include
5+
ms.date: 07/29/2024
6+
ms.author: anaharris
7+
---
8+
9+
## Consideration for private endpoint
10+
11+
Azure Private Link provides private connectivity from a virtual network to [Azure platform as a service (PaaS), customer-owned, or Microsoft partner services](/azure/private-link/private-endpoint-overview). Private Link simplifies the network architecture and secures the connection between endpoints in Azure by eliminating data exposure to the public internet.
12+
13+
For a successful recreation of your resource in the target region, the VNet and Subnet must be created before the actual recreation occurs.
14+
15+
### Considerations for Azure Private Endpoint DNS Integration
16+
17+
It’s important to correctly configure your DNS settings to resolve the private endpoint IP address to the fully qualified domain name (FQDN) of the connection string.
18+
19+
Existing Microsoft Azure services might already have a DNS configuration for a public endpoint. This configuration must be overridden to connect using your private endpoint.
20+
21+
The network interface associated with the private endpoint contains the information to configure your DNS. The network interface information includes FQDN and private IP addresses for your private link resource.
22+
23+
You can use the following options to configure your DNS settings for private endpoints:
24+
25+
- **Use the host file (only recommended for testing)**. You can use the host file on a virtual machine to override the DNS.
26+
- **Use a private DNS zone.** You can use private DNS zones to override the DNS resolution for a private endpoint. A private DNS zone can be linked to your virtual network to resolve specific domains.
27+
- **Use your DNS forwarder (optional).** You can use your DNS forwarder to override the DNS resolution for a private link resource. Create a DNS forwarding rule to use a private DNS zone on your DNS server hosted in a virtual network.

articles/operational-excellence/overview-relocation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following tables provide links to each Azure service relocation document. Th
6060
[Azure Backup](relocation-backup.md)| ✅ | ❌| ❌ |
6161
[Azure Batch](../batch/account-move.md?toc=/azure/operational-excellence/toc.json)|✅ | ✅| ❌ |
6262
[Azure Cache for Redis](../azure-cache-for-redis/cache-moving-resources.md?toc=/azure/operational-excellence/toc.json)| ✅ | ❌| ❌ |
63-
[Azure Container Registry](../container-registry/manual-regional-move.md)|✅ | ✅| |
63+
[Azure Container Registry](relocation-container-registry.md)|✅ | ✅| |
6464
[Azure Cosmos DB](relocation-cosmos-db.md)|✅ | ✅| ❌ |
6565
[Azure Database for MariaDB Server](../mariadb/howto-move-regions-portal.md?toc=/azure/operational-excellence/toc.json)|✅ | ✅| ❌ |
6666
[Azure Database for MySQL Server](../mysql/howto-move-regions-portal.md?toc=/azure/operational-excellence/toc.json)✅ | ✅| ❌ |
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
title: Relocate an Azure Container Registry to another region
3+
description: This article shows you how to relocate an Azure Container Registry to another region.
4+
ms.topic: concept
5+
ms.custom: devx-track-azurecli
6+
author: anaharris-ms
7+
ms.author: anaharris
8+
ms.date: 07/29/2024
9+
ms.service: container-registry
10+
---
11+
12+
# Relocate an Azure Container Registry to another region
13+
14+
This article shows you how to relocate Azure Container Registry resources to another region in the same subscription of the Active Directory tenant.
15+
16+
[!INCLUDE [container-registry-geo-replication-include](../../includes/container-registry-geo-replication-include.md)]
17+
18+
## Prerequisites
19+
20+
21+
- You can only relocate a registry within the same Active Directory tenant. This limitation applies to registries that are encrypted and unencrypted with a [customer-managed key](../container-registry/tutorial-enable-customer-managed-keys.md).
22+
23+
- If the source registry has [availability zones](../reliability/availability-zones-overview.md) enabled, then the target region must also support availability zones. For more information on availability zone support for Azure Container Registry, see [Enable zone redundancy in Azure Container Registry](../container-registry/zone-redundancy.md).
24+
25+
26+
27+
## Considerations for Service Endpoints
28+
29+
The virtual network service endpoints for Azure Container Registry restrict access to a specified virtual network. The endpoints can also restrict access to a list of IPv4 (internet protocol version 4) address ranges. Any user connecting to the registry from outside those sources is denied access. If Service endpoints were configured in the source region for the registry resource, the same would need to be done in the target one. The steps for this scenario are mentioned below:
30+
31+
- For a successful recreation of the registry to the target region, the VNet and Subnet must be created beforehand. If the move of these two resources is being carried out with the Azure Resource Mover tool, the service endpoints won’t be configured automatically and so you'll need to provide manual configuration.
32+
33+
- Secondly, changes need to be made in the IaC of the Azure Container Registry. In `networkAcl` section, under `virtualNetworkRules`, add the rule for the target subnet. Ensure that the `ignoreMissingVnetServiceEndpoint` flag is set to False, so that the IaC fails to deploy the Azure Container Registry in case the service endpoint isn’t configured in the target region. This will ensure that the prerequisites in the target region are met
34+
35+
36+
[!INCLUDE [considerations-for-private-endpoint](includes/private-endpoint-include.md)]
37+
38+
39+
- Azure Container Registry must be configured in the target region with premium tier.
40+
41+
- When public network access to a registry is disabled, registry access by certain trusted services - including Azure Security Center - requires enabling a network setting to bypass the network rules.
42+
43+
- If the registry has an approved private endpoint and public network access is disabled, repositories and tags can’t be listed outside the virtual network using the Azure portal, Azure CLI, or other tools.
44+
45+
- In case the case of a new replica, its imperative to manually add a new DNS record for the data endpoint in the target region.
46+
47+
## Downtime
48+
49+
To understand the possible downtimes involved, see [Cloud Adoption Framework for Azure: Select a relocation method](/azure/cloud-adoption-framework/relocate/select#select-a-relocation-method).
50+
51+
52+
53+
## Prepare
54+
55+
>[!NOTE]
56+
>If you only want to relocate a Container Registry that doesn't hold any client specific data and is to be moved alone, you can simply redeploy the registry by using [Bicep](/azure/templates/microsoft.containerregistry/registries?tabs=bicep&pivots=deployment-language-arm-template) or [JSON](/azure/templates/microsoft.containerregistry/registries?tabs=json&pivots=deployment-language-arm-template).
57+
>
58+
>To view other availability configuration templates, go to [Define resources with Bicep, ARM templates, and Terraform AzAPI provider](/azure/templates/)
59+
60+
**To prepare for relocation with data migration:**
61+
62+
1. Create a dependency map with all the Azure services used by the registry. For the services that are in scope of the relocation, you must choose the appropriate relocation strategy.
63+
64+
1. Identify the source networking layout for Azure Container Registry (ACR) like firewall and network isolation.
65+
66+
1. Retrieve any required images from the source registry for import into the target registry. To retrieve the images, run the following command:
67+
68+
```azurecli
69+
70+
Get-AzContainerRegistryRepository -RegistryName registry
71+
72+
```
73+
74+
1. Use [ACR Tasks](../container-registry/container-registry-tasks-overview.md) to retrieve automation configurations of the source registry for import into the target registry.
75+
76+
77+
### Export template
78+
79+
To get started, export a Resource Manager template. This template contains settings that describe your Container Registry. For more information on how to use exported templates, see [Use exported template from the Azure portal](../azure-resource-manager/templates/template-tutorial-Azure portale.md) and the [template reference](/azure/templates/microsoft.containerregistry/registries).
80+
81+
82+
1. In the [Azure portal](https://portal.azure.com), navigate to your source registry.
83+
1. In the menu, under **Automation**, select **Export template** > **Download**.
84+
85+
:::image type="content" source="media/relocation/container-registry/export-template.png" alt-text="Export template for container registry":::
86+
87+
1. Locate the .zip file that you downloaded from the portal, and unzip that file to a folder of your choice.
88+
89+
This zip file contains the .json files that include the template and scripts to deploy the template.
90+
91+
92+
### Modify template
93+
94+
Inspect the registry properties in the template JSON file you downloaded, and make necessary changes. At a minimum:
95+
96+
- Change the registry name's `defaultValue` to the desired name of the target registry
97+
- Update the `location` to the desired Azure region for the target registry
98+
99+
```json
100+
{
101+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
102+
"contentVersion": "1.0.0.0",
103+
"parameters": {
104+
"registries_myregistry_name": {
105+
"defaultValue": "myregistry",
106+
"type": "String"
107+
}
108+
},
109+
"variables": {},
110+
"resources": [
111+
{
112+
"type": "Microsoft.ContainerRegistry/registries",
113+
"apiVersion": "2020-11-01-preview",
114+
"name": "[parameters('myregistry_name')]",
115+
"location": "centralus",
116+
...
117+
}
118+
]
119+
}
120+
```
121+
122+
- Validate all the associated resources detail in the downloaded template such as Registry scopeMaps, replications configuration, Diagnostic settings like log analytics.
123+
124+
- If the source registry is encrypted, then [encrypt the target registry using a customer-managed key](../container-registry/tutorial-enable-customer-managed-keys.md#enable-a-customer-managed-key-by-using-a-resource-manager-template) and update the template with settings for the required managed identity, key vault, and key. You can only enable the customer-managed key when you deploy the registry.
125+
126+
127+
128+
### Create resource group
129+
130+
Create a resource group for the target registry using the [az group create](/cli/azure/group#az-group-create). The following example creates a resource group named *myResourceGroup* in the *eastus* location.
131+
132+
```azurecli
133+
az group create --name myResourceGroup --location eastus
134+
```
135+
136+
## Redeploy
137+
138+
Use the [az deployment group create](/cli/azure/deployment/group#az-deployment-group-create) command to deploy the target registry, using the template:
139+
140+
```azurecli
141+
az deployment group create --resource-group myResourceGroup \
142+
--template-file template.json --name mydeployment
143+
```
144+
145+
> [!NOTE]
146+
> If you see errors during deployment, you might need to update certain configurations in the template file and retry the command.
147+
148+
### Import registry content in target registry
149+
150+
After creating the registry in the target region:
151+
152+
1. Use the [az acr import](/cli/azure/acr#az-acr-import) command, or the equivalent PowerShell command `Import-AzContainerImage`, to import images and other artifacts you want to preserve from the source registry to the target registry. For command examples, see [Import container images to a container registry](../container-registry/container-registry-import-images.md).
153+
154+
1. Use the Azure CLI commands [az acr repository list](/cli/azure/acr/repository#az-acr-repository-list) and [az acr repository show-tags](/cli/azure/acr/repository#az-acr-repository-show-tags), or Azure PowerShell equivalents, to help enumerate the contents of your source registry.
155+
156+
1. Run the import command for individual artifacts, or script it to run over a list of artifacts.
157+
158+
The following sample Azure CLI script enumerates the source repositories and tags and then imports the artifacts to a target registry in the same Azure subscription. Modify as needed to import specific repositories or tags. To import from a registry in a different subscription or tenant, see examples in [Import container images to a container registry](../container-registry/container-registry-import-images.md).
159+
160+
```azurecli
161+
#!/bin/bash
162+
# Modify registry names for your environment
163+
SOURCE_REG=myregistry
164+
TARGET_REG=targetregistry
165+
166+
# Get list of source repositories
167+
REPO_LIST=$(az acr repository list \
168+
--name $SOURCE_REG --output tsv)
169+
170+
# Enumerate tags and import to target registry
171+
for repo in $REPO_LIST; do
172+
TAGS_LIST=$(az acr repository show-tags --name $SOURCE_REG --repository $repo --output tsv);
173+
for tag in $TAGS_LIST; do
174+
echo "Importing $repo:$tag";
175+
az acr import --name $TARGET_REG --source $SOURCE_REG.azurecr.io/$repo":"$tag;
176+
done
177+
done
178+
```
179+
1. Associate the dependent resources to the target Azure Container Registry such as log analytics workspace in Diagnostic settings.
180+
181+
1. Configure Azure Container Registry integration with both type of AKS clusters, provisioned or yet to be provisioned by running the following command:
182+
183+
184+
```azurecli
185+
186+
Set-AzAksCluster -Name myAKSCluster -ResourceGroupName myResourceGroup -AcrNameToAttach <acr-name>
187+
188+
```
189+
190+
1. Make the necessary changes to the Kubernetes manifest file to integrate same with relocated Azure Container Registry (ACR).
191+
192+
1. Update development and deployment systems to use the target registry instead of the source registry.
193+
194+
1. Update any client firewall rules to allow access to the target registry.
195+
196+
197+
## Verify
198+
199+
Confirm the following information in your target registry:
200+
201+
* Registry settings such as the registry name, service tier, public access, and replications
202+
* Repositories and tags for content that you want to preserve.
203+
204+
205+
## Delete original registry
206+
207+
After you have successfully deployed the target registry, migrated content, and verified registry settings, you may delete the source registry.
208+
209+
## Related content
210+
211+
- To move registry resources to a new resource group either in the same subscription or a [new subscription], see [Move Azure resources to a new resource group or subscription](../azure-resource-manager/management/move-resource-group-and-subscription.md).
212+
213+
214+
* Learn more about [importing container images](../container-registry/container-registry-import-images.md) to an Azure container registry from a public registry or another private registry.
215+
216+
* See the [Resource Manager template reference](/azure/templates/microsoft.containerregistry/registries) for Azure Container Registry.

0 commit comments

Comments
 (0)