Skip to content

Commit b82c6d1

Browse files
committed
edits
1 parent efc9c91 commit b82c6d1

File tree

5 files changed

+25
-68
lines changed

5 files changed

+25
-68
lines changed

articles/container-registry/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
items:
8585
- name: Restrict access using private endpoint
8686
href: container-registry-private-link.md
87-
- name: Restrict access from public networks
87+
- name: Allow access from selected public networks
8888
href: container-registry-access-selected-networks.md
8989
- name: Restrict access using service endpoint (preview)
9090
href: container-registry-vnet.md

articles/container-registry/container-registry-access-selected-networks.md

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
---
2-
title: Allow access from public networks
3-
description: Allow access to an Azure container registry from selected public IP addresses or address ranges.
2+
title: Configure access from public networks
3+
description: Configure IP rules to enable access to an Azure container registry from selected public IP addresses or address ranges.
44
ms.topic: article
55
ms.date: 05/04/2020
66
---
77

8-
# Allow access from selected public networks
8+
# Configure access from selected public networks
99

1010
An Azure container registry by default accepts connections over the internet from hosts on any network. This article shows how to configure your container registry to allow access from only specific public IP addresses or address ranges. Equivalent steps using the Azure CLI and Azure portal are provided.
1111

1212
In IP network rules, provide allowed internet address ranges using CIDR notation such as *16.17.18.0/24* or an individual IP addresses like *16.17.18.19*. IP network rules are only allowed for *public* internet IP addresses. IP address ranges reserved for private networks (as defined in RFC 1918) aren't allowed.
1313

14-
## Prerequisites
15-
16-
* If you don't already have a container registry, create one (Premium SKU required) and push a sample image such as `hello-world` from Docker Hub. For example, use the [Azure portal][quickstart-portal] or the [Azure CLI][quickstart-cli] to create a registry.
17-
18-
[!INCLUDE [Set up Docker-enabled VM](../../includes/container-registry-docker-vm-setup.md)]
14+
Configuring IP access rules is available in the **Premium** container registry service tier. For information about registry service tiers and limits, see [Azure Container Registry SKUs](container-registry-skus.md).
1915

2016
## Access from selected public network - CLI
2117

@@ -29,60 +25,39 @@ az acr update --name myContainerRegistry --default-action Deny
2925

3026
### Add network rule to registry
3127

32-
Use the [az acr network-rule add][az-acr-network-rule-add] command to add a network rule to your registry that allows access from a public IP address or range. For example, substitute the container registry's name and the public IP address of the VM in the following command.
28+
Use the [az acr network-rule add][az-acr-network-rule-add] command to add a network rule to your registry that allows access from a public IP address or range. For example, substitute the container registry's name and the public IP address of a VM in a virtual network.
3329

3430
```azurecli
3531
az acr network-rule add \
3632
--name mycontainerregistry \
3733
--ip-address <public-IP-address>
3834
```
3935

40-
Continue to [Verify access to the registry](#verify-access-to-the-registry).
36+
After adding a rule, it takes a few minutes for the rule to take effect.
4137

4238
## Access from selected public network - portal
4339

4440
1. In the portal, navigate to your container registry.
4541
1. Under **Settings**, select **Networking**.
4642
1. On the **Public access** tab, select to allow public access from **Selected networks**.
47-
1. Under **Firewall**, enter a public IP address, such as your test VM's public IP address. Or, enter an address range in CIDR notation that contains the VM's IP address.
43+
1. Under **Firewall**, enter a public IP address, such as the public IP address of a VM in a virtual network. Or, enter an address range in CIDR notation that contains the VM's IP address.
4844
1. Select **Save**.
4945

5046
![Configure firewall rule for container registry][acr-access-selected-networks]
5147

48+
After adding a rule, it takes a few minutes for the rule to take effect.
49+
5250
> [!TIP]
5351
> Optionally, enable registry access from a local client computer or IP address range. To allow this access, you need the computer's public IPv4 address. You can find this address using a search like "what is my IP address" in an Internet browser. The current client IPv4 address also appears automatically when you configure firewall settings on the **Networking** page in the portal.
5452
55-
Continue to [Verify access to the registry](#verify-access-to-the-registry).
56-
57-
## Verify access to the registry
58-
59-
After waiting a few minutes for the configuration to update, verify that the VM can access the container registry. Make an SSH connection to your VM, and run the [az acr login][az-acr-login] command to login to your registry.
60-
61-
```bash
62-
az acr login --name mycontainerregistry
63-
```
64-
65-
You can perform registry operations such as run `docker pull` to pull a sample image from the registry. Substitute an image and tag value appropriate for your registry, prefixed with the registry login server name (all lowercase):
66-
67-
```bash
68-
docker pull mycontainerregistry.azurecr.io/hello-world:v1
69-
```
70-
71-
Docker successfully pulls the image to the VM.
72-
73-
This example demonstrates that you can access the private container registry through the network access rule. However, the registry can't be accessed from a different login host that doesn't have a network access rule configured. If you attempt to login from another host using the `az acr login` command or `docker login` command, output is similar to the following:
74-
75-
```Console
76-
Error response from daemon: login attempt to https://xxxxxxx.azurecr.io/v2/ failed with status: 403 Forbidden
77-
```
78-
7953
## Disable public network access
8054

8155
In certain scenarios, you might want to disable all public network access to registry. For example, if you set up a [private endpoint](container-registry-private-link.md) for a registry in a virtual network, you might also decide to disable access from outside the virtual network.
8256

8357
### Disable public access - CLI
8458

8559
Substitute the name of your registry in the following [az acr update][az-acr-update] command:
60+
8661
```azurecli
8762
az acr update --name myContainerRegistry --default-action Deny
8863
```
@@ -110,18 +85,11 @@ az acr update --name myContainerRegistry --default-action Allow
11085
1. Under **Firewall**, select each address range, and then select the Delete icon.
11186
1. On the **Public access** tab, in **Allow public access**, select **All networks**. Then select **Save**.
11287

113-
## Clean up resources
114-
115-
If you created all the Azure resources in the same resource group and no longer need them, you can optionally delete the resources by using a single [az group delete](/cli/azure/group) command:
116-
117-
```azurecli
118-
az group delete --name myResourceGroup
119-
```
120-
121-
To clean up your resources in the portal, navigate to the myResourceGroup resource group. Once the resource group is loaded, click on **Delete resource group** to remove the resource group and the resources stored there.
122-
12388
## Next steps
12489

90+
* To restrict access to a registry using a private endpoint in a virtual network, see [Configure Azure Private Link for an Azure container registry](container-registry-private-link.md).
91+
* If you need to set up registry access rules from behind a client firewall, see [Configure rules to access an Azure container registry behind a firewall](container-registry-firewall-access-rules.md).
92+
12593
[az-acr-login]: /cli/azure/acr#az-acr-login
12694
[az-acr-network-rule-add]: /cli/azure/acr/network-rule/#az-acr-network-rule-add
12795
[az-acr-network-rule-remove]: /cli/azure/acr/network-rule/#az-acr-network-rule-remove

articles/container-registry/container-registry-private-link.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Set up private link
3-
description: Set up a private endpoint on a container registry and enable a private link in a local virtual network
3+
description: Set up a private endpoint on a container registry and enable access over a private link in a local virtual network
44
ms.topic: article
55
ms.date: 05/04/2020
66
---
77

88
# Configure Azure Private Link for an Azure container registry
99

10-
Set up a [private endpoint](../private-link/private-endpoint-overview.md) for your Azure container registry so that clients on an Azure virtual network securely access the registry over a [private link](../private-link/private-link-overview.md). The private endpoint uses an IP address from the virtual network address space for your registry. Network traffic between the clients on the virtual network and the registry traverses the virtual network and a private link on the Microsoft backbone network, eliminating exposure from the public internet.
10+
Set up a [private endpoint](../private-link/private-endpoint-overview.md) for your Azure container registry so that clients on an Azure virtual network securely access the registry over a [private link](../private-link/private-link-overview.md). The private endpoint uses a private IP address from the virtual network address space for your registry. Network traffic between the clients on the virtual network and the registry traverses the virtual network and a private link on the Microsoft backbone network, eliminating exposure from the public internet.
1111

1212
You can [configure DNS settings](../private-link/private-endpoint-overview.md#dns-configuration) for your private endpoint, so that the settings resolve to the registry's allocated private IP address. With DNS configuration, clients and services in the network can continue to access the registry at the registry's fully qualified domain name, such as *myregistry.azurecr.io*.
1313

@@ -197,6 +197,7 @@ Set up a private link when you create a registry, or add a private link to an ex
197197
1. Select the **Networking** tab.
198198
1. In **Network connectivity**, select **Private endpoint** > **+ Add**.
199199
1. Enter or select the following information:
200+
200201
| Setting | Value |
201202
| ------- | ----- |
202203
| Subscription | Select your subscription. |
@@ -212,7 +213,7 @@ Set up a private link when you create a registry, or add a private link to an ex
212213
|||
213214
1. Configure the remaining registry settings, and then select **Review + Create**.
214215

215-
![Create registry with private endpoint](./media/container-registry-private-link/private-link-create-portal.png)
216+
![Create registry with private endpoint](./media/container-registry-private-link/private-link-create-portal.png)
216217

217218
### Create a private endpoint - existing registry
218219

@@ -263,7 +264,7 @@ After the private endpoint is created, DNS settings in the private zone appear o
263264
1. On the **Private endpoints** tab, select the private endpoint you created.
264265
1. On the **Overview** page, review the link settings and custom DNS settings.
265266

266-
![Endpoint DNS settings](./media/container-registry-private-link/private-endpoint-overview.png)
267+
![Endpoint DNS settings](./media/container-registry-private-link/private-endpoint-overview.png)
267268

268269
Your private link is now configured and ready for use.
269270

@@ -357,7 +358,7 @@ To clean up your resources in the portal, navigate to your resource group. Once
357358
## Next steps
358359

359360
* To learn more about Private Link, see the [Azure Private Link](../private-link/private-link-overview.md) documentation.
360-
* An alternative to private link is to set up network access rules to restrict registry access. To learn more, see [Restrict access to an Azure container registry using an Azure virtual network or firewall rules](container-registry-vnet.md).
361+
* If you need to set up registry access rules from behind a client firewall, see [Configure rules to access an Azure container registry behind a firewall](container-registry-firewall-access-rules.md).
361362

362363
<!-- LINKS - external -->
363364
[docker-linux]: https://docs.docker.com/engine/installation/#supported-platforms

articles/container-registry/container-registry-vnet.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.date: 05/04/2020
1212
This article shows how to configure a container registry service endpoint in a virtual network.
1313

1414
> [!IMPORTANT]
15-
> Azure Container Registry also supports [Azure Private Link](container-registry-private-link.md), enabling private endpoints from a virtual network to be placed on a registry. Private endpoints are accessible from within the virtual network, using private IP addresses. We recommend using private endpoints instead of service endpoints in most network scenarios.
15+
> Azure Container Registry now supports [Azure Private Link](container-registry-private-link.md), enabling private endpoints from a virtual network to be placed on a registry. Private endpoints are accessible from within the virtual network, using private IP addresses. We recommend using private endpoints instead of service endpoints in most network scenarios.
1616
1717
Configuring a registry service endpoint is available in the **Premium** container registry service tier. For information about registry service tiers and limits, see [Azure Container Registry SKUs](container-registry-skus.md).
1818

@@ -128,7 +128,7 @@ docker pull mycontainerregistry.azurecr.io/hello-world:v1
128128

129129
Docker successfully pulls the image to the VM.
130130

131-
This example demonstrates that you can access the private container registry through the network access rule. However, the registry can't be accessed from a different login host that doesn't have a network access rule configured. If you attempt to login from another host using the `az acr login` command or `docker login` command, output is similar to the following:
131+
This example demonstrates that you can access the private container registry through the network access rule. However, the registry can't be accessed from a login host that doesn't have a network access rule configured. If you attempt to login from another host using the `az acr login` command or `docker login` command, output is similar to the following:
132132

133133
```Console
134134
Error response from daemon: login attempt to https://xxxxxxx.azurecr.io/v2/ failed with status: 403 Forbidden
@@ -145,7 +145,7 @@ To restore the registry to allow, access by default, remove any network rules t
145145
To see a list of network rules configured for your registry, run the following [az acr network-rule list][az-acr-network-rule-list] command:
146146

147147
```azurecli
148-
az acr network-rule list--name mycontainerregistry
148+
az acr network-rule list --name mycontainerregistry
149149
```
150150

151151
For each rule that is configured, run the [az acr network-rule remove][az-acr-network-rule-remove] command to remove it. For example:
@@ -157,12 +157,6 @@ az acr network-rule remove \
157157
--name mycontainerregistry \
158158
--subnet /subscriptions/ \
159159
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myDockerVMVNET/subnets/myDockerVMSubnet
160-
161-
# Remove a rule that allows access for an IP address or CIDR range such as 23.45.1.0/24.
162-
163-
az acr network-rule remove \
164-
--name mycontainerregistry \
165-
--ip-address 23.45.1.0/24
166160
```
167161

168162
#### Allow access
@@ -184,14 +178,8 @@ To clean up your resources in the portal, navigate to the myResourceGroup resour
184178

185179
## Next steps
186180

187-
Several virtual network resources and features were discussed in this article, though briefly. The Azure Virtual Network documentation covers these topics extensively:
188-
189-
* [Virtual network](https://docs.microsoft.com/azure/virtual-network/manage-virtual-network)
190-
* [Subnet](https://docs.microsoft.com/azure/virtual-network/virtual-network-manage-subnet)
191-
* [Service endpoints](https://docs.microsoft.com/azure/virtual-network/virtual-network-service-endpoints-overview)
192-
193-
194-
If instead you need to set up access rules for resources to reach a container registry from behind a client firewall, see [Configure rules to access an Azure container registry behind a firewall](container-registry-firewall-access-rules.md).
181+
* To restrict access to a registry using a private endpoint in a virtual network, see [Configure Azure Private Link for an Azure container registry](container-registry-private-link.md).
182+
* If you need to set up registry access rules from behind a client firewall, see [Configure rules to access an Azure container registry behind a firewall](container-registry-firewall-access-rules.md).
195183

196184

197185
<!-- IMAGES -->
-239 Bytes
Loading

0 commit comments

Comments
 (0)