Skip to content

Commit 7ec4e6c

Browse files
Merge pull request #233787 from craigshoemaker/aca/wp-cli-update
[Container Apps] Workload profiles: Update vnet info
2 parents 54e126d + 025e591 commit 7ec4e6c

File tree

2 files changed

+81
-15
lines changed

2 files changed

+81
-15
lines changed

articles/container-apps/workload-profiles-manage-cli.md

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
77
ms.topic: how-to
8-
ms.date: 04/10/2023
8+
ms.date: 04/11/2023
99
ms.author: cshoe
10+
zone_pivot_groups: container-apps-vnet-types
1011
---
1112

1213
# Manage workload profiles in a Consumption + Dedicated workload profiles plan structure (preview)
1314

15+
Learn to manage a Container Apps environment with workload profile support.
16+
1417
## Supported regions
1518

1619
The following regions support workload profiles during preview:
@@ -24,17 +27,35 @@ The following regions support workload profiles during preview:
2427

2528
## Create a container app in a profile
2629

27-
At a high level, when you create a container app into a workload profile, you go through the following steps:
30+
::: zone pivot="aca-vnet-managed"
31+
32+
Azure Container Apps run in an environment, which uses a virtual network (VNet). By default, your Container App environment is created with a managed VNet that is automatically generated for you. Generated VNets are inaccessible to you as they're created in Microsoft's tenant.
33+
34+
Create a container apps environment with a [custom VNet](./workload-profiles-manage-cli.md?pivots=aca-vnet-custom) if you need any of the following features:
35+
36+
- [User defined routes](user-defined-routes.md)
37+
- Integration with Application Gateway
38+
- Network Security Groups
39+
- Communicating with resources behind private endpoints in your virtual network
40+
41+
::: zone-end
2842

29-
- Select a workload profile
30-
- Create or provide a VNet
31-
- Create a subnet with a `Microsoft.App/environments` delegation
32-
- Create a new environment
33-
- Create a container app associated with the workload profile in the environment
43+
::: zone pivot="aca-vnet-custom"
3444

35-
Use the following commands to create an environment with a workload profile.
45+
When you create an environment with a custom VNet, you have full control over the VNet configuration. This amount of control gives you the option to implement the following features:
3646

37-
1. Create a VNet
47+
- [User defined routes](user-defined-routes.md)
48+
- Integration with Application Gateway
49+
- Network Security Groups
50+
- Communicating with resources behind private endpoints in your virtual network
51+
52+
::: zone-end
53+
54+
Use the following commands to create an environment with workload profile support.
55+
56+
::: zone pivot="aca-vnet-custom"
57+
58+
1. Create a VNet.
3859

3960
```bash
4061
az network vnet create \
@@ -44,7 +65,7 @@ Use the following commands to create an environment with a workload profile.
4465
--name "<VNET_NAME>"
4566
```
4667

47-
1. Create a subnet
68+
1. Create a subnet delegated to `Microsoft.App/environments`.
4869

4970
```bash
5071
az network vnet subnet create \
@@ -58,6 +79,8 @@ Use the following commands to create an environment with a workload profile.
5879

5980
Copy the ID value and paste into the next command.
6081

82+
The `Microsoft.App/environments` delegation is required to give the Container Apps runtime the needed control over your VNet to run workload profiles in the Container Apps environment.
83+
6184
You can specify as small as a `/27` CIDR (32 IPs-8 reserved) for the subnet. Some things to consider if you're going to specify a `/27` CIDR:
6285
6386
- There are 11 IP addresses reserved for Container Apps infrastructure. Therefore, a `/27` CIDR has a maximum of 21 IP available addresses.
@@ -68,10 +91,14 @@ Use the following commands to create an environment with a workload profile.
6891
|---|---|
6992
| Every replica requires one IP. Users can't have apps with more than 21 replicas across all apps. Zero downtime deployment requires double the IPs since the old revision is running until the new revision is successfully deployed. | Every instance (VM node) requires a single IP. You can have up to 21 instances across all workload profiles, and hundreds or more replicas running on these workload profiles. |
7093

94+
::: zone-end
95+
7196
1. Create *Consumption + Dedicated* environment with workload profile support
7297

98+
::: zone pivot="aca-vnet-custom"
99+
73100
>[!Note]
74-
> In Container Apps, you can configure whether your Container Apps will allow public ingress or only ingress from within your VNet at the environment level. In order to restrict ingress to just your VNet, you will need to set the `--internal-only` flag.
101+
> In Container Apps, you can configure whether your Container Apps will allow public ingress or only ingress from within your VNet at the environment level. In order to restrict ingress to just your VNet, you need to set the `--internal-only` flag.
75102

76103
# [External environment](#tab/external-env)
77104

@@ -80,8 +107,7 @@ Use the following commands to create an environment with a workload profile.
80107
--enable-workload-profiles \
81108
--resource-group "<RESOURCE_GROUP>" \
82109
--name "<NAME>" \
83-
--location "<LOCATION>" \
84-
--infrastructure-subnet-resource-id "<SUBNET_ID>"
110+
--location "<LOCATION>"
85111
```
86112

87113
# [Internal environment](#tab/internal-env)
@@ -92,12 +118,26 @@ Use the following commands to create an environment with a workload profile.
92118
--resource-group "<RESOURCE_GROUP>" \
93119
--name "<NAME>" \
94120
--location "<LOCATION>" \
95-
--infrastructure-subnet-resource-id "<SUBNET_ID>"
121+
--infrastructure-subnet-resource-id "<SUBNET_ID>" \
96122
--internal-only true
97123
```
98124

99125
---
100126

127+
::: zone-end
128+
129+
::: zone pivot="aca-vnet-managed"
130+
131+
```bash
132+
az containerapp env create \
133+
--enable-workload-profiles \
134+
--resource-group "<RESOURCE_GROUP>" \
135+
--name "<NAME>" \
136+
--location "<LOCATION>"
137+
```
138+
139+
::: zone-end
140+
101141
This command can take up to 10 minutes to complete.
102142

103143
1. Check status of environment. Here, you're looking to see if the environment is created successfully.
@@ -112,6 +152,8 @@ Use the following commands to create an environment with a workload profile.
112152
113153
1. Create a new container app.
114154
155+
# [External environment](#tab/external-env)
156+
115157
```azurecli
116158
az containerapp create \
117159
--resource-group "<RESOURCE_GROUP>" \
@@ -123,7 +165,22 @@ Use the following commands to create an environment with a workload profile.
123165
--workload-profile-name "Consumption"
124166
```
125167
126-
This command deploys the application to the built in Consumption workload profile. If you want to create an app in a dedicated workload profile, you first need to [add the profile to the environment](#add-profiles).
168+
# [Internal environment](#tab/internal-env)
169+
170+
```azurecli
171+
az containerapp create \
172+
--resource-group "<RESOURCE_GROUP>" \
173+
--name "<CONTAINER_APP_NAME>" \
174+
--target-port 80 \
175+
--ingress internal \
176+
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
177+
--environment "<ENVIRONMENT_NAME>" \
178+
--workload-profile-name "Consumption"
179+
```
180+
181+
---
182+
183+
This command deploys the application to the built-in Consumption workload profile. If you want to create an app in a dedicated workload profile, you first need to [add the profile to the environment](#add-profiles).
127184
128185
This command creates the new application in the environment using a specific workload profile.
129186

articles/zone-pivot-groups.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,15 @@ groups:
19161916
- id: aca-arm
19171917
title: Azure Resource Manager (ARM) template
19181918
# Owner: cshoe
1919+
- id: container-apps-vnet-types
1920+
title: Virtual network
1921+
prompt: Select a virtual network configuration
1922+
pivots:
1923+
- id: aca-vnet-managed
1924+
title: Managed
1925+
- id: aca-vnet-custom
1926+
title: Custom
1927+
# Owner: cshoe
19191928
- id: container-apps-registry-types
19201929
title: Registry types
19211930
prompt: Select the type of container registry

0 commit comments

Comments
 (0)