I have Azure Devops pipeline A to tiger another pipeline (pipeline B in the same project). Here pipeline B has some object type parameters as below and
parameters:
envList:
- production
- dr
alertList:
- alertnumber: 01
alertrulename: xxxxxxxxx
appname: xxxxxxxxxxxxxxx
query: >
union AppExceptions, AppRequests
| where AppRoleName == "xxxxxx"
alertDescription: xxxxxx
frequencyInMinutes: 10
timeWindowInMinutes: 10
severity: 1
operator: GreaterThan
threshold: 40
autoMitigate: true
enabled: true
todeploy: yes
here in each parameter "alertList", I have a flag "todeploy: yes" to decide whether the particular alert need to be triggered in a particular envt, as below and this settings working fine for pipeline B.
stages:
- ${{ each environment in parameters.envList }}:
- stage: BuilD_ARM_LogAnalytic_Artifact_${{ environment }}
jobs:
- ${{ each alert in parameters.alertList }}:
- ${{ if eq(alert.todeploy, 'yes') }}:
- job: BuilD_ARM_LogAnalytic_Artifact_${{ environment }}_${{ alert.alertnumber }}
displayName: '${{ alert.alertRuleName }}'
condition: eq('${{ alert.todeploy }}', 'yes')
But when I used Pipeline A to trigger the pipeline B,
steps:
- task: TriggerBuild@4
inputs:
definitionIsInCurrentTeamProject: true
buildDefinition: 'pipelineA'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: false
useSameSourceVersion: false
useCustomSourceVersion: false
useSameBranch: false
waitForQueuedBuildsToFinish: false
storeInEnvironmentVariable: false
templateParameters: 'alertList: [todeploy: yes]'
authenticationMethod: 'Personal Access Token'
password: 'xxxxxxxxxxxxxxxxx'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
dependentOnFailedBuildCondition: false
checkbuildsoncurrentbranch: false
failTaskIfConditionsAreNotFulfilled: false
The Pipeline B is not getting executed and error as below
Team Project: xxxxxxxxxxxxx
Using current Collection Url
Server URL: xxxxxxxxxxxxxxxxxxxxxxxxxx
Using following Authentication Method: Personal Access Token
Using Personal Access Token
Provided team project was guid.
Context is Build - using Build Environment Variables
Build shall be triggered for same user that triggered current build: xxxxxx
Will trigger build with following template parameters: alertList: [todeploy: yes]
Found parameter alertList with value: [todeploy: yes]
Error during request (1/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 1 seconds before retrying request...
Error during request (2/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 2 seconds before retrying request...
Error during request (3/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 4 seconds before retrying request...
Error during request (4/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
Will wait 8 seconds before retrying request...
Error during request (5/5)
Error message: Error: Could not queue the build because there were validation errors or warnings.
##[debug]task result: Failed
##[error]Request failed after 5 tries - see error messages in the log
Not Sure, how to pass these parameters both envt: dr
and alertList
with flag (todeploy: yes) from pipelineA