Skip to content

Commit 8509d6a

Browse files
committed
Address feedback from Copilot, Gwen, Twitter
1 parent 287eee0 commit 8509d6a

13 files changed

+158
-130
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
44
"features": {
55
"ghcr.io/va-h/devcontainers-features/uv:1": {},
6-
"ghcr.io/devcontainers/features/node:1": { "version": "lts" }
6+
"ghcr.io/devcontainers/features/node:1": { "version": "lts" },
7+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
8+
"ghcr.io/azure/azure-dev/azd:latest": {}
79
},
810
"postCreateCommand": "uv sync",
911
"forwardPorts": [6277, 6274],

infra/core/ai/cognitiveservices.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ output id string = account.id
4141
output name string = account.name
4242
output location string = account.location
4343
output skuName string = account.sku.name
44-
output key string = account.listKeys().key1

infra/core/host/container-app-upsert.bicep

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ param containerCpuCoreCount string = '0.5'
4040
@description('Memory allocated to a single container instance, e.g. 1Gi')
4141
param containerMemory string = '1.0Gi'
4242

43-
@description('Workload profile name to use for the container app when using private ingress')
44-
param workloadProfileName string = 'Warm'
45-
46-
resource existingApp 'Microsoft.App/containerApps@2022-03-01' existing = if (exists) {
43+
resource existingApp 'Microsoft.App/containerApps@2025-01-01' existing = if (exists) {
4744
name: name
4845
}
4946

@@ -70,8 +67,6 @@ module app 'container-app.bicep' = {
7067
env: env
7168
imageName: exists ? existingApp.properties.template.containers[0].image : ''
7269
targetPort: targetPort
73-
// Pass workload profile name parameter
74-
workloadProfileName: workloadProfileName
7570
}
7671
}
7772

infra/core/host/container-app.bicep

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ param containerCpuCoreCount string = '0.5'
4040
@description('Memory allocated to a single container instance, e.g. 1Gi')
4141
param containerMemory string = '1.0Gi'
4242

43-
@description('Workload profile name to use for the container app when using private ingress')
44-
param workloadProfileName string = 'Warm'
45-
4643
resource userIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = {
4744
name: identityName
4845
}
@@ -111,7 +108,7 @@ resource app 'Microsoft.App/containerApps@2025-01-01' = {
111108
}
112109
}
113110

114-
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-03-01' existing = {
111+
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2025-01-01' existing = {
115112
name: containerAppsEnvironmentName
116113
}
117114

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

Lines changed: 28 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,45 @@ param name string
22
param location string = resourceGroup().location
33
param tags object = {}
44

5-
param daprEnabled bool = false
65
param logAnalyticsWorkspaceName string = ''
7-
param applicationInsightsName string = ''
86

97
@description('Virtual network name for container apps environment.')
108
param vnetName string = ''
119
@description('Subnet name for container apps environment integration.')
1210
param subnetName string = ''
13-
param subnetResourceId string
11+
param subnetResourceId string = ''
1412

15-
param usePrivateIngress bool = true
13+
param usePrivateIngress bool = false
1614

17-
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2025-01-01' = {
18-
name: name
19-
location: location
20-
tags: tags
21-
properties: {
22-
appLogsConfiguration: !empty(logAnalyticsWorkspaceName) ? {
23-
destination: 'log-analytics'
24-
logAnalyticsConfiguration: {
25-
customerId: logAnalyticsWorkspace.properties.customerId
26-
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey
27-
}
28-
} : null
29-
daprAIInstrumentationKey: daprEnabled && !empty(applicationInsightsName) ? applicationInsights.properties.InstrumentationKey : ''
30-
vnetConfiguration: (!empty(vnetName) && !empty(subnetName)) ? {
31-
// Use proper subnet resource ID format
32-
infrastructureSubnetId: subnetResourceId
33-
internal: usePrivateIngress
34-
} : null
35-
// Configure workload profile for dedicated environment (not consumption)
36-
workloadProfiles: usePrivateIngress
37-
? [
38-
{
39-
name: 'Consumption'
40-
workloadProfileType: 'Consumption'
41-
}
42-
{
43-
name: 'Warm'
44-
workloadProfileType: 'D4'
45-
minimumCount: 1
46-
maximumCount: 3
47-
}
48-
]
49-
: []
50-
}
51-
}
15+
var useVnet = !empty(vnetName) && !empty(subnetName)
16+
var useLogging = !empty(logAnalyticsWorkspaceName)
5217

53-
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = if (!empty(logAnalyticsWorkspaceName)) {
18+
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = if (useLogging) {
5419
name: logAnalyticsWorkspaceName
5520
}
5621

57-
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (daprEnabled && !empty(applicationInsightsName)){
58-
name: applicationInsightsName
22+
module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.11.3' = {
23+
name: take('${name}-aca-env', 64)
24+
params: {
25+
name: name
26+
location: location
27+
tags: tags
28+
zoneRedundant: false
29+
publicNetworkAccess: 'Enabled'
30+
appLogsConfiguration: useLogging ? {
31+
destination: 'log-analytics'
32+
logAnalyticsConfiguration: {
33+
customerId: logAnalyticsWorkspace!.properties.customerId
34+
sharedKey: logAnalyticsWorkspace!.listKeys().primarySharedKey
35+
}
36+
} : {
37+
destination: 'azure-monitor'
38+
}
39+
internal: useVnet ? usePrivateIngress : false
40+
infrastructureSubnetResourceId: useVnet ? subnetResourceId : ''
41+
}
5942
}
6043

61-
output defaultDomain string = containerAppsEnvironment.properties.defaultDomain
62-
output name string = containerAppsEnvironment.name
63-
output resourceId string = containerAppsEnvironment.id
44+
output defaultDomain string = containerAppsEnvironment.outputs.defaultDomain
45+
output name string = containerAppsEnvironment.outputs.name
46+
output resourceId string = containerAppsEnvironment.outputs.resourceId

infra/core/host/container-apps.bicep

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ param tags object = {}
55
param containerAppsEnvironmentName string
66
param containerRegistryName string
77
param logAnalyticsWorkspaceName string = ''
8-
param applicationInsightsName string = ''
98

109
@description('Virtual network name for container apps environment.')
1110
param vnetName string = ''
@@ -23,7 +22,6 @@ module containerAppsEnvironment 'container-apps-environment.bicep' = {
2322
location: location
2423
tags: tags
2524
logAnalyticsWorkspaceName: logAnalyticsWorkspaceName
26-
applicationInsightsName: applicationInsightsName
2725
vnetName: vnetName
2826
subnetName: subnetName
2927
usePrivateIngress: usePrivateIngress

0 commit comments

Comments
 (0)