21
21
},
22
22
"github-organization" : {
23
23
"type" : " string" ,
24
- "defaultValue" :" " ,
24
+ "defaultValue" : " " ,
25
25
"metadata" : {
26
26
"description" : " GitHub Organization - provide only if application-scope is organization"
27
27
}
28
28
},
29
29
"github-enterprise" : {
30
30
"type" : " string" ,
31
- "defaultValue" :" " ,
31
+ "defaultValue" : " " ,
32
32
"metadata" : {
33
33
"description" : " GitHub Enterprise - provide only if application-scope is enterprise"
34
34
}
39
39
"metadata" : {
40
40
"description" : " Docker image for metrics viewer - use default or replace with your own"
41
41
}
42
+ },
43
+ "subnetId" : {
44
+ "type" : " string" ,
45
+ "defaultValue" : " " ,
46
+ "metadata" : {
47
+ "description" : " Subnet ID (at least /23) for the managed environment when deploying app without public access"
48
+ }
42
49
}
43
50
},
44
51
"variables" : {
45
52
"environmentName" : " [concat(parameters('name'),'-env')]" ,
46
53
"workspaceName" : " [concat(parameters('name'),'-ai')]" ,
47
- "app-scope" : " [if(not(empty(parameters('github-organization'))), 'organization', if(not(empty(parameters('github-enterprise'))), 'enterprise', ''))]"
54
+ "app-scope" : " [if(not(empty(parameters('github-organization'))), 'organization', if(not(empty(parameters('github-enterprise'))), 'enterprise', ''))]" ,
55
+ "vnetId" : " [concat(split(parameters('subnetId'), '/subnets/')[0])]" ,
56
+ "dnsZoneName" : " azurecontainerapps.io"
48
57
},
49
58
"resources" : [
50
59
{
130
139
"customerId" : " [reference(concat('Microsoft.OperationalInsights/workspaces/', variables('workspaceName')), '2020-08-01').customerId]" ,
131
140
"sharedKey" : " [listKeys(concat('Microsoft.OperationalInsights/workspaces/', variables('workspaceName')), '2020-08-01').primarySharedKey]"
132
141
}
142
+ },
143
+ "vnetConfiguration" : {
144
+ "infrastructureSubnetId" : " [parameters('subnetId')]" ,
145
+ "internal" : " [if(equals(parameters('subnetId'), ''), json('false'), json('true'))]"
133
146
}
134
147
}
135
148
},
149
+ {
150
+ "type" : " Microsoft.Network/privateDnsZones" ,
151
+ "apiVersion" : " 2020-06-01" ,
152
+ "name" : " [variables('dnsZoneName')]" ,
153
+ "location" : " global" ,
154
+ "condition" : " [not(equals(parameters('subnetId'), ''))]" ,
155
+ "properties" : {},
156
+ "dependsOn" : [
157
+ " [concat('Microsoft.App/managedEnvironments/', variables('environmentName'))]"
158
+ ]
159
+ },
160
+ {
161
+ "type" : " Microsoft.Network/privateDnsZones/A" ,
162
+ "apiVersion" : " 2020-06-01" ,
163
+ "name" : " [concat(variables('dnsZoneName'), '/*')]" ,
164
+ "properties" : {
165
+ "TTL" : 3600 ,
166
+ "ARecords" : [
167
+ {
168
+ "ipv4Address" : " [reference(concat('Microsoft.App/managedEnvironments/', variables('environmentName')), '2024-02-02-preview').staticIp]"
169
+
170
+ }
171
+ ]
172
+ },
173
+ "dependsOn" : [
174
+ " [resourceId('Microsoft.Network/privateDnsZones', variables('dnsZoneName'))]" ,
175
+ " [concat('Microsoft.App/managedEnvironments/', variables('environmentName'))]"
176
+ ]
177
+ },
178
+ {
179
+ "type" : " Microsoft.Network/privateDnsZones/virtualNetworkLinks" ,
180
+ "apiVersion" : " 2020-06-01" ,
181
+ "name" : " [concat(variables('dnsZoneName'), '/', variables('environmentName'), '-vnet-link')]" ,
182
+ "location" : " global" ,
183
+ "dependsOn" : [
184
+ " [resourceId('Microsoft.Network/privateDnsZones', variables('dnsZoneName'))]"
185
+ ],
186
+ "condition" : " [not(equals(parameters('subnetId'), ''))]" ,
187
+ "properties" : {
188
+ "virtualNetwork" : {
189
+ "id" : " [variables('vnetId')]"
190
+ },
191
+ "registrationEnabled" : false
192
+ }
193
+ },
136
194
{
137
195
"apiVersion" : " 2020-08-01" ,
138
196
"name" : " [variables('workspaceName')]" ,
147
205
"workspaceCapping" : {}
148
206
}
149
207
}
150
- ]
208
+ ],
209
+ "outputs" : {
210
+ "metrics-viewer-url" : {
211
+ "type" : " string" ,
212
+ "value" : " [reference(concat('Microsoft.App/containerapps/', parameters('name')), '2024-02-02-preview').latestRevisionFqdn]"
213
+ },
214
+ "managed-environment-ip" : {
215
+ "type" : " string" ,
216
+ "value" : " [reference(concat('Microsoft.App/managedEnvironments/', variables('environmentName')), '2024-02-02-preview').staticIp]"
217
+ },
218
+ "managed-environment-domain" : {
219
+ "type" : " string" ,
220
+ "value" : " [reference(concat('Microsoft.App/managedEnvironments/', variables('environmentName')), '2024-02-02-preview').defaultDomain]"
221
+ }
222
+ }
151
223
}
0 commit comments