Skip to content

Commit 6ec8a2f

Browse files
committed
Bring back workload profile name
1 parent ee8a447 commit 6ec8a2f

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

docs/deploy_private.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you want to disable public access when deploying the Chat App, you can do so
3232
Deploying with public access disabled adds additional cost to your deployment. Please see pricing for the following products:
3333

3434
* [Azure Container Registry](https://azure.microsoft.com/pricing/details/container-registry/): Premium tier is used when virtual network is added (required for private links), which incurs additional costs.
35-
* [Azure Container Apps](https://azure.microsoft.com/pricing/details/container-apps/): Workload profiles environment is used when virtual network is added (required for private links), which incurs additional costs. Additionally, min replica count is set to 1, so you will be charged for at least one instance. If you need to customize the environment configuration further, edit the container-apps-environment.bicep file.
35+
* [Azure Container Apps](https://azure.microsoft.com/pricing/details/container-apps/): Workload profiles environment is used when virtual network is added (required for private links), which incurs additional costs. Additionally, min replica count is set to 1, so you will be charged for at least one instance.
3636
* [VPN Gateway](https://azure.microsoft.com/pricing/details/vpn-gateway/): VpnGw2 SKU. Pricing includes a base monthly cost plus an hourly cost based on the number of connections.
3737
* [Virtual Network](https://azure.microsoft.com/pricing/details/virtual-network/): Pay-as-you-go tier. Costs based on data processed.
3838

infra/core/host/container-apps-environment.bicep

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ param subnetResourceId string
1010

1111
param usePrivateIngress bool = true
1212

13+
@allowed(['Consumption', 'D4', 'D8', 'D16', 'D32', 'E4', 'E8', 'E16', 'E32', 'NC24-A100', 'NC48-A100', 'NC96-A100'])
14+
param workloadProfile string
15+
16+
// Make sure that we are using a non-consumption workload profile for private endpoints
17+
var finalWorkloadProfile = (usePrivateIngress && workloadProfile == 'Consumption') ? 'D4' : workloadProfile
18+
19+
var minimumCount = usePrivateIngress ? 1 : 0
20+
var maximumCount = usePrivateIngress ? 3 : 2
21+
1322
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2025-02-02-preview' = {
1423
name: name
1524
location: location
@@ -37,12 +46,17 @@ resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2025-02-02-
3746
}
3847
{
3948
name: 'Warm'
40-
workloadProfileType: 'D4'
41-
minimumCount: 1
42-
maximumCount: 3
49+
workloadProfileType: finalWorkloadProfile
50+
minimumCount: minimumCount
51+
maximumCount: maximumCount
52+
}
53+
]
54+
: [
55+
{
56+
name: 'Consumption'
57+
workloadProfileType: 'Consumption'
4358
}
4459
]
45-
: []
4660
}
4761
}
4862

infra/core/host/container-apps.bicep

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ param applicationInsightsName string = ''
99

1010
@description('Virtual network name for container apps environment.')
1111
param vnetName string = ''
12-
@description('Subnet name for container apps environment integration.')
13-
param subnetName string = ''
12+
13+
@allowed(['Consumption', 'D4', 'D8', 'D16', 'D32', 'E4', 'E8', 'E16', 'E32', 'NC24-A100', 'NC48-A100', 'NC96-A100'])
14+
param workloadProfile string
1415

1516
param subnetResourceId string = ''
1617

@@ -26,6 +27,7 @@ module containerAppsEnvironment 'container-apps-environment.bicep' = {
2627
applicationInsightsName: applicationInsightsName
2728
usePrivateIngress: usePrivateIngress
2829
subnetResourceId: subnetResourceId
30+
workloadProfile: workloadProfile
2931
}
3032
}
3133

infra/main.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ param runningOnAdo string = ''
297297
@description('Used by azd for containerapps deployment')
298298
param webAppExists bool
299299

300+
@allowed(['Consumption', 'D4', 'D8', 'D16', 'D32', 'E4', 'E8', 'E16', 'E32', 'NC24-A100', 'NC48-A100', 'NC96-A100'])
301+
param azureContainerAppsWorkloadProfile string
302+
300303
@allowed(['appservice', 'containerapps'])
301304
param deploymentTarget string = 'appservice'
302305
param acaIdentityName string = deploymentTarget == 'containerapps' ? '${environmentName}-aca-identity' : ''
@@ -530,6 +533,7 @@ module containerApps 'core/host/container-apps.bicep' = if (deploymentTarget ==
530533
logAnalyticsWorkspaceName: useApplicationInsights ? monitoring.outputs.logAnalyticsWorkspaceName : ''
531534
subnetResourceId: usePrivateEndpoint ? isolation.outputs.appSubnetId : ''
532535
usePrivateIngress: usePrivateEndpoint
536+
workloadProfile: azureContainerAppsWorkloadProfile
533537
}
534538
}
535539

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@
344344
"webAppExists": {
345345
"value": "${SERVICE_WEB_RESOURCE_EXISTS=false}"
346346
},
347+
"azureContainerAppsWorkloadProfile": {
348+
"value": "${AZURE_CONTAINER_APPS_WORKLOAD_PROFILE=Consumption}"
349+
},
347350
"useMediaDescriberAzureCU": {
348351
"value": "${USE_MEDIA_DESCRIBER_AZURE_CU=false}"
349352
},

0 commit comments

Comments
 (0)