-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathdeploy_container_app.bicep
More file actions
72 lines (65 loc) · 2.02 KB
/
deploy_container_app.bicep
File metadata and controls
72 lines (65 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
param location string
param containerAppName string
param containerEnvId string
// Managed identity with ACR pull role
param managedIdentityId string
param azureContainerRegistry string
param azureContainerRegistryImage string
param azureContainerRegistryImageTag string
param containerEnvVars array = []
param enableIngress bool = true
param probes array = []
param allowedOrigins array = []
param minReplicas int = 1
param maxReplicas int = 1
//Todo: Add Appconfig endpoint as Env variable
resource processorContainerApp 'Microsoft.App/containerApps@2024-03-01' = {
name: containerAppName
location: location
identity: {
type: 'SystemAssigned, UserAssigned'
userAssignedIdentities: {
'${managedIdentityId}': {}
}
}
properties: {
managedEnvironmentId: containerEnvId
environmentId: containerEnvId
workloadProfileName: 'Consumption'
configuration:{
registries: null
ingress: enableIngress ? {
external: true
transport: 'auto'
allowInsecure: true
corsPolicy: length(allowedOrigins) > 0 ? {
allowedOrigins: allowedOrigins
allowedMethods: [ 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS' ]
allowedHeaders: [ 'Authorization', 'Content-Type', '*' ]
} : null
} : null
}
template: {
containers: [
{
image: '${azureContainerRegistry}/${azureContainerRegistryImage}:${azureContainerRegistryImageTag}'
name: containerAppName
env: containerEnvVars
probes: probes
resources: {
cpu: 4
memory: '8Gi'
}
}
]
scale: {
minReplicas: minReplicas
maxReplicas: maxReplicas
}
}
}
}
output containerName string = processorContainerApp.name
output processorContainerAppId string = processorContainerApp.id
output principalId string = processorContainerApp.identity.principalId
output containerEndPoint string = enableIngress ? 'https://${processorContainerApp.properties.configuration.ingress.fqdn}' : ''