Skip to content

Commit f0c67e3

Browse files
Merge pull request #285487 from bowen5/add-subnet-delegation-aca
[ACA] Add subnet delegation steps when create VNet Injection envs
2 parents 6b6e729 + a1eec97 commit f0c67e3

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

articles/container-apps/vnet-custom-internal.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,28 @@ $vnet = New-AzVirtualNetwork @VnetArgs
145145

146146
---
147147

148+
When using the Workload profiles environment, you need to do one more step to delegate the subnet to `Microsoft.App/environments`. This delegation is not applicable to the Consumption only environment.
149+
150+
# [Bash](#tab/bash)
151+
152+
```azurecli-interactive
153+
az network vnet subnet update \
154+
--resource-group $RESOURCE_GROUP \
155+
--vnet-name $VNET_NAME \
156+
--name infrastructure-subnet \
157+
--delegations Microsoft.App/environments
158+
```
159+
160+
# [Azure PowerShell](#tab/azure-powershell)
161+
162+
```azurepowershell-interactive
163+
$delegation = New-AzDelegation -Name 'containerApp' -ServiceName 'Microsoft.App/environments'
164+
$vnet = Set-AzVirtualNetworkSubnetConfig -Name $SubnetArgs.Name -VirtualNetwork $vnet -AddressPrefix $SubnetArgs.AddressPrefix -Delegation $delegation
165+
$vnet | Set-AzVirtualNetwork
166+
```
167+
168+
---
169+
148170
With the VNET established, you can now query for the infrastructure subnet ID.
149171

150172
# [Bash](#tab/bash)

articles/container-apps/vnet-custom.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,28 @@ $vnet = New-AzVirtualNetwork @VnetArgs
145145

146146
---
147147

148+
When using the Workload profiles environment, you need to do one more step to delegate the subnet to `Microsoft.App/environments`. This delegation is not applicable to the Consumption only environment.
149+
150+
# [Bash](#tab/bash)
151+
152+
```azurecli-interactive
153+
az network vnet subnet update \
154+
--resource-group $RESOURCE_GROUP \
155+
--vnet-name $VNET_NAME \
156+
--name infrastructure-subnet \
157+
--delegations Microsoft.App/environments
158+
```
159+
160+
# [Azure PowerShell](#tab/azure-powershell)
161+
162+
```azurepowershell-interactive
163+
$delegation = New-AzDelegation -Name 'containerApp' -ServiceName 'Microsoft.App/environments'
164+
$vnet = Set-AzVirtualNetworkSubnetConfig -Name $SubnetArgs.Name -VirtualNetwork $vnet -AddressPrefix $SubnetArgs.AddressPrefix -Delegation $delegation
165+
$vnet | Set-AzVirtualNetwork
166+
```
167+
168+
---
169+
148170
With the virtual network created, you can retrieve the ID for the infrastructure subnet.
149171

150172
# [Bash](#tab/bash)

0 commit comments

Comments
 (0)