Skip to content

Commit ed6c790

Browse files
authored
Merge pull request #84155 from SebastianSchuetze/patch-1
Added example on how to scale Azure Pipelines
2 parents 080e6f2 + 9e84a87 commit ed6c790

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

articles/container-apps/scale-app.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,52 @@ The following example shows how to create a memory scaling rule.
198198
- In this example, the container app scales when memory usage exceeds 50%.
199199
- At a minimum, a single replica remains in memory for apps that scale based on memory utilization.
200200

201+
## Azure Pipelines
202+
203+
Azure Pipelines scaling allows your container app to scale in or out depending on the number of jobs in the Azure DevOps agent pool. With Azure Pipelines, your app can scale to zero, but you need [at least one agent registered in the pool schedule additional agents](https://keda.sh/blog/2021-05-27-azure-pipelines-scaler/). For more information regarding this scaler, see [KEDA Azure Pipelines scaler](https://keda.sh/docs/2.4/scalers/azure-pipelines/).
204+
205+
The following example shows how to create a memory scaling rule.
206+
207+
```json
208+
{
209+
...
210+
"resources": {
211+
...
212+
"properties": {
213+
...
214+
"template": {
215+
...
216+
"scale": {
217+
"minReplicas": "0",
218+
"maxReplicas": "10",
219+
"rules": [{
220+
"name": "azdo-agent-scaler",
221+
"custom": {
222+
"type": "azure-pipelines",
223+
"metadata": {
224+
"poolID": "<pool id>",
225+
"targetPipelinesQueueLength": "1"
226+
},
227+
"auth": [
228+
{
229+
"secretRef": "<secret reference pat>",
230+
"triggerParameter": "personalAccessToken"
231+
},
232+
{
233+
"secretRef": "<secret reference Azure DevOps url>",
234+
"triggerParameter": "organizationURL"
235+
}
236+
]
237+
}
238+
}]
239+
}
240+
}
241+
}
242+
}
243+
}
244+
```
245+
246+
In this example, the container app scales when at least one job is waiting in the pool queue.
201247

202248
## Considerations
203249

0 commit comments

Comments
 (0)