Skip to content

Commit 0732e8c

Browse files
authored
Merge pull request #123694 from juliusl/juliusl/pr/update-dedicated-agentpool-vnet-reqs
feat: update dedicated agent pool vnet req docs
2 parents 013b6c3 + f056327 commit 0732e8c

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

articles/container-registry/tasks-agent-pools.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,41 @@ az acr agentpool update \
9393

9494
Task agent pools require access to the following Azure services. The following firewall rules must be added to any existing network security groups or user-defined routes.
9595

96-
| Direction | Protocol | Source | Source Port | Destination | Dest Port | Used |
97-
| --------- | -------- | -------------- | ----------- | -------------------- | --------- | ------- |
98-
| Outbound | TCP | VirtualNetwork | Any | AzureKeyVault | 443 | Default |
99-
| Outbound | TCP | VirtualNetwork | Any | Storage | 443 | Default |
100-
| Outbound | TCP | VirtualNetwork | Any | EventHub | 443 | Default |
101-
| Outbound | TCP | VirtualNetwork | Any | AzureActiveDirectory | 443 | Default |
102-
| Outbound | TCP | VirtualNetwork | Any | AzureMonitor | 443,12000 | Default |
96+
| Direction | Protocol | Source | Source Port | Destination | Dest Port | Used | Remarks |
97+
| --------- | -------- | -------------- | ----------- | -------------------- | --------- | ------- | ------------------------------------------------- |
98+
| Outbound | TCP | VirtualNetwork | Any | AzureKeyVault | 443 | Default | |
99+
| Outbound | TCP | VirtualNetwork | Any | Storage | 443 | Default | |
100+
| Outbound | TCP | VirtualNetwork | Any | EventHub | 443 | Default | |
101+
| Outbound | TCP | VirtualNetwork | Any | AzureActiveDirectory | 443 | Default | |
102+
| Outbound | TCP | VirtualNetwork | Any | AzureMonitor | 443,12000 | Default | Port 12000 is a unique port used for diagnostics |
103103

104104
> [!NOTE]
105105
> If your tasks require additional resources from the public internet, add the corresponding rules. For example, additional rules are needed to run a docker build task that pulls the base images from Docker Hub, or restores a NuGet package.
106106
107107
Customers basing their deployments with MCR can refer to [MCR/MAR firewall rules.](https://github.com/microsoft/containerregistry/blob/main/docs/client-firewall-rules.md)
108108

109+
#### Advanced network configuration
110+
111+
If the standard Firewall/NSG (Network Security Group) rules are deemed too permissive, and more fine-grained control is required for outbound connections, consider the following approach:
112+
113+
- Enable service endpoints on the agent pool subnet. This grants the agent pool access to its service dependencies while maintaining a secure network posture.
114+
- It's important to note that outbound Firewall/NSG rules are still necessary. These rules facilitate the Virtual Network's ability to switch the source IP from public to private, which is an additional step beyond enabling service endpoints.
115+
116+
More information on service endpoints is documented [here][az-vnet-svc-ep].
117+
118+
At minimum, the following service endpoints will be required
119+
120+
- Microsoft.AzureActiveDirectory
121+
- Microsoft.ContainerRegistry
122+
- Microsoft.EventHub
123+
- Microsoft.KeyVault
124+
- Microsoft.Storage (or the corresponding storage regions taking geo-replication into account)
125+
126+
> [!NOTE]
127+
> Currently a service endpoint for Azure Monitor does not exist. If outbound traffic for Azure Monitor is not configured, the agent pool will be unable to emit diagnostic logs but may appear to still operate normally. In this case ACR will be unable to help fully troubleshoot any issues encountered so it is important that the network administrator take this into account when planning the network configuration.
128+
129+
Also, it is important to note that all of ACR Tasks have pre-cached images for some of the more common use cases. Tasks will only cache a single version at a time, meaning that if the full tagged image reference is used, then the build agent will attempt to pull the image. For example, a common use case is `cmd: mcr.microsoft.com/acr/acr-cli:<tag>`. However, the pre-cached version is frequently updated, which means the actual version on the machine will likely be higher. In this case, the network configuration must configure a route for outbound traffic to the target registry host which in the example above would be mcr.microsoft.com. The same rules would apply to any other external public registry (docker.io, quay.io, ghcr.io, etc.).
130+
109131
### Create pool in VNet
110132

111133
The following example creates an agent pool in the *mysubnet* subnet of network *myvnet*:
@@ -200,3 +222,4 @@ For more examples of container image builds and maintenance in the cloud, check
200222
[az-acr-task-create]: /cli/azure/acr/task#az_acr_task_create
201223
[az-acr-task-run]: /cli/azure/acr/task#az_acr_task_run
202224
[create-reg-cli]: container-registry-get-started-azure-cli.md
225+
[az-vnet-svc-ep]: ../virtual-network/virtual-network-service-endpoints-overview.md#secure-azure-services-to-virtual-networks

0 commit comments

Comments
 (0)