Work around:
- Split For-Each inner activity to a separate pipeline
- Set concurrency limit for that pipeline to 3
- Set For-Each to run in batch mode with batchCount larger than total number of items to iterate over
JSON for workaround:
{
"name": "Wait",
"properties": {
"activities": [
{
"name": "Wait",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": {
"value": "@pipeline().parameters.p_WaitTime",
"type": "Expression"
}
}
}
],
"concurrency": 3,
"parameters": {
"p_WaitTime": {
"type": "int"
}
},
"annotations": []
}
}
{
"name": "ForEach",
"properties": {
"activities": [
{
"name": "ForEach",
"type": "ForEach",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"items": {
"value": "@variables('v_foreach')",
"type": "Expression"
},
"isSequential": false,
"batchCount": 10,
"activities": [
{
"name": "Wait",
"type": "ExecutePipeline",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"pipeline": {
"referenceName": "Wait",
"type": "PipelineReference"
},
"waitOnCompletion": true,
"parameters": {
"p_WaitTime": {
"value": "@item().WaitTime",
"type": "Expression"
}
}
}
}
]
}
}
],
"variables": {
"v_foreach": {
"type": "Array",
"defaultValue": [
{
"No": 1,
"WaitTime": 60
},
{
"No": 2,
"WaitTime": 1
},
{
"No": 3,
"WaitTime": 1
},
{
"No": 4,
"WaitTime": 60
},
{
"No": 5,
"WaitTime": 1
},
{
"No": 6,
"WaitTime": 1
},
{
"No": 7,
"WaitTime": 60
}
]
}
},
"annotations": []
}
}