Skip to content

Commit b8925f8

Browse files
Added example on how to scale Azure Pipelines
Hope the info is enough. I added also a blog post link
1 parent f81fcb3 commit b8925f8

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

articles/container-apps/scale-app.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,53 @@ 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 agent to scale in or out depending on how long the queue of waiting jobs in an Azure DevOps agent pool is. Azure Pipelines scaling allows your container app to scale to 0 but you need to be aware of one problem to solve, which is [explained on KEDA's blog post](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.
247+
- On how to set up a full example with Azure Container apps and Azure Pipelines is [explained in this blog post](https://www.razorspoint.com/2021/11/19/scalable-container-based-azure-pipelines-pools-with-azure-container-apps/).
201248

202249
## Considerations
203250

0 commit comments

Comments
 (0)