You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -71,6 +71,45 @@ In the following example, the revision scales out up to five replicas and can sc
71
71
72
72
### Example
73
73
74
+
::: zone pivot="container-apps-bicep"
75
+
76
+
The `http` section defines an HTTP scale rule.
77
+
78
+
| Scale property | Description | Default value | Min value | Max value |
79
+
|---|---|---|---|---|
80
+
|`concurrentRequests`| When the number of HTTP requests exceeds this value, then another replica is added. Replicas continue to add to the pool up to the `maxReplicas` amount. | 10 | 1 | n/a |
> Set the `properties.configuration.activeRevisionsMode` property of the container app to `single`, when using non-HTTP event scale rules.
110
+
111
+
::: zone-end
112
+
74
113
::: zone pivot="azure-resource-manager"
75
114
76
115
The `http` section defines an HTTP scale rule.
@@ -166,13 +205,49 @@ In the following example, the container app revision scales out up to five repli
166
205
167
206
### Example
168
207
208
+
::: zone pivot="container-apps-bicep"
209
+
210
+
The `tcp` section defines an TCP scale rule.
211
+
212
+
| Scale property | Description | Default value | Min value | Max value |
213
+
|---|---|---|---|---|
214
+
|`concurrentConnections`| When the number of concurrent TCP connections exceeds this value, then another replica is added. Replicas continue to be added up to the `maxReplicas` amount as the number of concurrent connections increases. | 10 | 1 | n/a |
| Scale property | Description | Default value | Min value | Max value |
174
249
|---|---|---|---|---|
175
-
|`concurrentConnections`| When the number of concurrent TCP connections exceeds this value, then another replica is added. Replicas continue to be added up to the `maxReplicas` amount as the number of concurrent connections increase. | 10 | 1 | n/a |
250
+
|`concurrentConnections`| When the number of concurrent TCP connections exceeds this value, then another replica is added. Replicas continue to be added up to the `maxReplicas` amount as the number of concurrent connections increases. | 10 | 1 | n/a |
176
251
177
252
```json
178
253
{
@@ -231,7 +306,7 @@ az containerapp create \
231
306
232
307
::: zone pivot="azure-portal"
233
308
234
-
Not supported in the Azure portal. Use the [Azure CLI](scale-app.md?pivots=azure-cli#tcp) or [Azure Resource Manager](scale-app.md?&pivots=azure-resource-manager#tcp) to configure a TCP scale rule.
309
+
Not supported in the Azure portal. Use the [Azure CLI](scale-app.md?pivots=azure-cli#tcp), [Azure Resource Manager](scale-app.md?&pivots=azure-resource-manager#tcp), or [Bicep](scale-app.md?&pivots=container-apps-bicep#tcp) to configure a TCP scale rule.
235
310
236
311
::: zone-end
237
312
@@ -254,6 +329,134 @@ This example shows how to convert an [Azure Service Bus scaler](https://keda.sh/
254
329
255
330
For authentication, KEDA scaler authentication parameters take [Container Apps secrets](manage-secrets.md) or [managed identity](managed-identity.md#scale-rules).
256
331
332
+
::: zone pivot="container-apps-bicep"
333
+
334
+
The following procedure shows you how to convert a KEDA scaler to a Container App scale rule. This snippet is an excerpt of a Bicep template to show you where each section fits in context of the overall template.
Container Apps scale rules support secrets-based authentication. Scale rules for Azure resources, including Azure Queue Storage, Azure Service Bus, and Azure Event Hubs, also support managed identity. Where possible, use managed identity authentication to avoid storing secrets within the app.
400
+
401
+
#### Use secrets
402
+
403
+
To use secrets for authentication, you need to create a secret in the container app's `secrets` array. The secret value is used in the `auth` array of the scale rule.
404
+
405
+
KEDA scalers can use secrets in a [TriggerAuthentication](https://keda.sh/docs/latest/concepts/authentication/) that is referenced by the `authenticationRef` property. You can map the TriggerAuthentication object to the Container Apps scale rule.
406
+
407
+
1. Find the `TriggerAuthentication` object referenced by the KEDA `ScaledObject` specification.
408
+
409
+
1. In the `TriggerAuthentication` object, find each `secretTargetRef` and its associated secret.
Some scalers support metadata with the `FromEnv` suffix to reference a value in an environment variable. Container Apps looks at the first container listed in the ARM template for the environment variable.
426
+
427
+
Refer to the [considerations section](#considerations) for more security related information.
428
+
429
+
#### Using managed identity
430
+
431
+
Container Apps scale rules can use managed identity to authenticate with Azure services. The following Bicep template passes in system-based managed identity to authenticate for an Azure Queue scaler.
432
+
433
+
```bicep
434
+
scale: {
435
+
minReplicas: 0
436
+
maxReplicas: 4
437
+
rules: [
438
+
{
439
+
name: 'azure-queue'
440
+
custom: {
441
+
type: 'azure-queue'
442
+
metadata: {
443
+
accountName: '<ACCOUNT_NAME>'
444
+
queueName: '<QUEUE_NAME>'
445
+
queueLength: '1'
446
+
},
447
+
identity: 'system'
448
+
}
449
+
}
450
+
]
451
+
}
452
+
```
453
+
454
+
Replace the `<PLACEHOLDERS`> with your values.
455
+
456
+
To learn more about using managed identity with scale rules, see [Managed identity](managed-identity.md#scale-rules).
457
+
458
+
::: zone-end
459
+
257
460
::: zone pivot="azure-resource-manager"
258
461
259
462
The following procedure shows you how to convert a KEDA scaler to a Container App scale rule. This snippet is an excerpt of an ARM template to show you where each section fits in context of the overall template.
@@ -308,15 +511,15 @@ First, you define the type and metadata of the scale rule.
308
511
309
512
1. From the KEDA scaler specification, find the `type` value.
1. In the ARM template, add all metadata values to the `custom.metadata` section of the scale rule.
322
525
@@ -358,7 +561,7 @@ KEDA scalers can use secrets in a [TriggerAuthentication](https://keda.sh/docs/l
358
561
359
562
Container Apps scale rules can use managed identity to authenticate with Azure services. The following ARM template passes in system-based managed identity to authenticate for an Azure Queue scaler.
360
563
361
-
```
564
+
```json
362
565
"scale": {
363
566
"minReplicas": 0,
364
567
"maxReplicas": 4,
@@ -368,8 +571,8 @@ Container Apps scale rules can use managed identity to authenticate with Azure s
368
571
"custom": {
369
572
"type": "azure-queue",
370
573
"metadata": {
371
-
"accountName": "apptest123",
372
-
"queueName": "queue1",
574
+
"accountName": "<ACCOUNT_NAME>",
575
+
"queueName": "<QUEUE_NAME>",
373
576
"queueLength": "1"
374
577
},
375
578
"identity": "system"
@@ -379,6 +582,8 @@ Container Apps scale rules can use managed identity to authenticate with Azure s
379
582
}
380
583
```
381
584
585
+
Replace the `<PLACEHOLDERS`> with your values.
586
+
382
587
To learn more about using managed identity with scale rules, see [Managed identity](managed-identity.md#scale-rules).
0 commit comments