forked from zlatko-ms/az-capps-private
-
Notifications
You must be signed in to change notification settings - Fork 0
/
caenv.bicep
51 lines (44 loc) · 1.55 KB
/
caenv.bicep
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
@description('environnement name')
param caEnvName string
@description('environnement location')
param caEnvLocation string = resourceGroup().location
@description('environnement tags')
param caEnvTags object = {}
@description('environnement log analytics name')
param caEnvLawName string
@description('environnement infra subnet id')
param caEnvVnetInfraSubnetId string
@description('set to true if the environnement is private, i.e vnet injected')
param caEnvPrivate bool = true
@description('set to true for zone redundant environnement')
param caEnvZoneRedundant bool = false
@description('name of th kv holidng secrets for connection to the log analytics')
var tags = union(caEnvTags, {
Component: 'ContainerAppEnv'
} )
//fetch the law in order to get the primary shared key below to avoid secret output
resource law 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = {
name: caEnvLawName
}
resource capps 'Microsoft.App/managedEnvironments@2022-03-01' = {
name: caEnvName
location: caEnvLocation
tags: tags
properties: {
appLogsConfiguration: {
destination: 'log-analytics'
logAnalyticsConfiguration: {
customerId: law.properties.customerId
sharedKey: law.listKeys().primarySharedKey
}
}
vnetConfiguration: {
infrastructureSubnetId: caEnvVnetInfraSubnetId
internal: caEnvPrivate
}
zoneRedundant: caEnvZoneRedundant
}
}
output caEnvId string = capps.id
output caEnvDefaultDomain string = capps.properties.defaultDomain
output caEnvStaticIp string = capps.properties.staticIp