@@ -2,7 +2,7 @@ private import bicep
2
2
3
3
module Containers {
4
4
/**
5
- * Represents a Microsoft.ContainerApp/containerApps resource.
5
+ * Represents a Microsoft.ContainerApp/containerApps resource (2025-02-02-preview) .
6
6
* See: https://learn.microsoft.com/en-us/azure/templates/microsoft.app/containerapps
7
7
*/
8
8
class ContainerResource extends Resource {
@@ -11,6 +11,31 @@ module Containers {
11
11
*/
12
12
ContainerResource ( ) { this .getResourceType ( ) .regexpMatch ( "^Microsoft.App/containerApps@.*" ) }
13
13
14
+ /**
15
+ * Returns the extendedLocation property.
16
+ */
17
+ Expr getExtendedLocation ( ) { result = this .getProperty ( "extendedLocation" ) }
18
+
19
+ /**
20
+ * Returns the identity property.
21
+ */
22
+ Expr getIdentity ( ) { result = this .getProperty ( "identity" ) }
23
+
24
+ /**
25
+ * Returns the kind property.
26
+ */
27
+ StringLiteral getKind ( ) { result = this .getProperty ( "kind" ) }
28
+
29
+ /**
30
+ * Returns the managedBy property.
31
+ */
32
+ StringLiteral getManagedBy ( ) { result = this .getProperty ( "managedBy" ) }
33
+
34
+ /**
35
+ * Returns the name property (overrides base Resource).
36
+ */
37
+ override string getName ( ) { result = super .getName ( ) }
38
+
14
39
/**
15
40
* Returns the properties object for the container app resource.
16
41
*/
@@ -44,23 +69,44 @@ module Containers {
44
69
result = this .getTemplate ( ) .getContainer ( index )
45
70
}
46
71
47
- Network:: Ingress getNetworkIngress ( ) {
48
- result = this .getConfiguration ( ) .getNetworkIngress ( )
49
- }
72
+ Network:: Ingress getNetworkIngress ( ) { result = this .getConfiguration ( ) .getNetworkIngress ( ) }
50
73
51
- Network:: CorsPolicy getCorsPolicy ( ) {
52
- result = this .getNetworkIngress ( ) .getCorsPolicy ( )
53
- }
74
+ Network:: CorsPolicy getCorsPolicy ( ) { result = this .getNetworkIngress ( ) .getCorsPolicy ( ) }
75
+
76
+ /**
77
+ * Returns the SKU object for the container registry resource.
78
+ */
79
+ Sku getSku ( ) { result = this .getProperty ( "sku" ) }
80
+
81
+ Tags getTags ( ) { result = this .getProperty ( "tags" ) }
54
82
55
83
/**
56
84
* Returns a string representation of the container app resource.
57
85
*/
58
86
override string toString ( ) { result = "ContainerResource" }
59
87
}
60
88
89
+ class ContainerRegistry extends Resource {
90
+ /**
91
+ * Constructs a ContainerRegistry for Microsoft.ContainerRegistry/containerRegistries resources (2025-02-02-preview).
92
+ */
93
+ ContainerRegistry ( ) {
94
+ this .getResourceType ( ) .regexpMatch ( "^Microsoft.ContainerRegistry/registries@.*$" )
95
+ }
96
+
97
+ /**
98
+ * Returns the SKU object for the container registry resource.
99
+ */
100
+ Sku getSku ( ) { result = this .getProperty ( "sku" ) }
101
+
102
+ Tags getTags ( ) { result = this .getProperty ( "tags" ) }
103
+
104
+ override string toString ( ) { result = "ContainerRegistry" }
105
+ }
106
+
61
107
module ContainerProperties {
62
108
/**
63
- * Represents the properties object for a container app resource.
109
+ * Represents the properties object for a container app resource (2025-02-02-preview) .
64
110
*/
65
111
class Properties extends Object {
66
112
private ContainerResource containerResource ;
@@ -80,11 +126,31 @@ module Containers {
80
126
*/
81
127
ContainerConfiguration getConfiguration ( ) { result = this .getProperty ( "configuration" ) }
82
128
129
+ /**
130
+ * Returns the environmentId property.
131
+ */
132
+ StringLiteral getEnvironmentId ( ) { result = this .getProperty ( "environmentId" ) }
133
+
134
+ /**
135
+ * Returns the managedEnvironmentId property.
136
+ */
137
+ StringLiteral getManagedEnvironmentId ( ) { result = this .getProperty ( "managedEnvironmentId" ) }
138
+
139
+ /**
140
+ * Returns the patchingConfiguration property.
141
+ */
142
+ Expr getPatchingConfiguration ( ) { result = this .getProperty ( "patchingConfiguration" ) }
143
+
83
144
/**
84
145
* Returns the template property.
85
146
*/
86
147
ContainerTemplate getTemplate ( ) { result = this .getProperty ( "template" ) }
87
148
149
+ /**
150
+ * Returns the workloadProfileName property.
151
+ */
152
+ StringLiteral getWorkloadProfileName ( ) { result = this .getProperty ( "workloadProfileName" ) }
153
+
88
154
string toString ( ) { result = "ContainerProperties" }
89
155
}
90
156
@@ -109,6 +175,15 @@ module Containers {
109
175
*/
110
176
ContainerSecret getSecrets ( ) { result = this .getProperty ( "secrets" ) .( Array ) .getElements ( ) }
111
177
178
+ ContainerSecret getSecret ( string name ) {
179
+ exists ( ContainerSecret secret |
180
+ secret = this .getSecrets ( ) and
181
+ secret .getName ( ) .getValue ( ) = name
182
+ |
183
+ result = secret
184
+ )
185
+ }
186
+
112
187
/**
113
188
* Returns the active revisions mode as a StringLiteral.
114
189
*/
@@ -124,6 +199,67 @@ module Containers {
124
199
*/
125
200
Expr getTemplate ( ) { result = this .getProperty ( "template" ) }
126
201
202
+ /**
203
+ * Returns the Dapr configuration object, if present.
204
+ *
205
+ * @return The Dapr configuration expression.
206
+ */
207
+ Expr getDapr ( ) { result = this .getProperty ( "dapr" ) }
208
+
209
+ /**
210
+ * Returns the identity settings object, if present.
211
+ *
212
+ * @return The identity settings expression.
213
+ */
214
+ Expr getIdentitySettings ( ) { result = this .getProperty ( "identitySettings" ) }
215
+
216
+ /**
217
+ * Returns the ingress configuration object, if present.
218
+ *
219
+ * @return The ingress configuration expression.
220
+ */
221
+ Expr getIngress ( ) { result = this .getProperty ( "ingress" ) }
222
+
223
+ /**
224
+ * Returns all container registries defined in the configuration.
225
+ *
226
+ * @return The container registry objects as an array.
227
+ */
228
+ ContainerRegistry getRegistries ( ) {
229
+ result = this .getProperty ( "registries" ) .( Array ) .getElements ( )
230
+ }
231
+
232
+ /**
233
+ * Returns a specific container registry by index.
234
+ *
235
+ * @param index The index of the registry.
236
+ * @return The container registry at the specified index.
237
+ */
238
+ ContainerRegistry getRegistry ( int index ) {
239
+ result = this .getProperty ( "registries" ) .( Array ) .getElement ( index )
240
+ }
241
+
242
+ /**
243
+ * Returns the runtime configuration object, if present.
244
+ *
245
+ * @return The runtime configuration expression.
246
+ */
247
+ Expr getRuntime ( ) { result = this .getProperty ( "runtime" ) }
248
+
249
+ /**
250
+ * Returns the service configuration object, if present.
251
+ *
252
+ * @return The service configuration expression.
253
+ */
254
+ Expr getService ( ) { result = this .getProperty ( "service" ) }
255
+
256
+ /**
257
+ * Returns the target label property, if present.
258
+ *
259
+ * @return The target label string literal.
260
+ */
261
+ StringLiteral getTargetLabel ( ) { result = this .getProperty ( "targetLabel" ) }
262
+
127
263
string toString ( ) { result = "ContainerConfiguration" }
128
264
}
129
265
@@ -172,6 +308,38 @@ module Containers {
172
308
*/
173
309
ContainerApp getContainers ( ) { result = this .getProperty ( "containers" ) .( Array ) .getElements ( ) }
174
310
311
+ /**
312
+ * Returns the initContainers defined in the template.
313
+ */
314
+ Expr getInitContainers ( ) { result = this .getProperty ( "initContainers" ) }
315
+
316
+ /**
317
+ * Returns the revisionSuffix property.
318
+ */
319
+ StringLiteral getRevisionSuffix ( ) { result = this .getProperty ( "revisionSuffix" ) }
320
+
321
+ /**
322
+ * Returns the scale property.
323
+ */
324
+ Expr getScale ( ) { result = this .getProperty ( "scale" ) }
325
+
326
+ /**
327
+ * Returns the serviceBinds property.
328
+ */
329
+ Expr getServiceBinds ( ) { result = this .getProperty ( "serviceBinds" ) }
330
+
331
+ /**
332
+ * Returns the terminationGracePeriodSeconds property.
333
+ */
334
+ Expr getTerminationGracePeriodSeconds ( ) {
335
+ result = this .getProperty ( "terminationGracePeriodSeconds" )
336
+ }
337
+
338
+ /**
339
+ * Returns the volumes property.
340
+ */
341
+ Expr getVolumes ( ) { result = this .getProperty ( "volumes" ) }
342
+
175
343
/**
176
344
* Returns a specific container by index from the template.
177
345
*/
@@ -292,5 +460,37 @@ module Containers {
292
460
293
461
string toString ( ) { result = "ContainerEnv" }
294
462
}
463
+
464
+ class ContainerRegistry extends Object {
465
+ private ContainerConfiguration configuration ;
466
+
467
+ /**
468
+ * Constructs a ContainerRegistry for the given configuration.
469
+ */
470
+ ContainerRegistry ( ) { this = configuration .getProperty ( "registries" ) .( Array ) .getElements ( ) }
471
+
472
+ /**
473
+ * Returns the registry server URL.
474
+ */
475
+ StringLiteral getServer ( ) { result = this .getProperty ( "server" ) }
476
+
477
+ /**
478
+ * Returns the username for the registry.
479
+ */
480
+ StringLiteral getUsername ( ) { result = this .getProperty ( "username" ) }
481
+
482
+ /**
483
+ * Returns the password for the registry.
484
+ */
485
+ StringLiteral getPassword ( ) {
486
+ exists ( StringLiteral ref | ref = this .getProperty ( "passwordSecretRef" ) |
487
+ result = configuration .getSecret ( ref .getValue ( ) ) .getValue ( )
488
+ )
489
+ or
490
+ result = this .getProperty ( "password" )
491
+ }
492
+
493
+ string toString ( ) { result = "ContainerRegistry" }
494
+ }
295
495
}
296
496
}
0 commit comments