Since you can pass a .yaml structure as object to a pipeline. You can try below workaround.
Define Runtime parameters in your pipeline to hold the value contents of the .xlsx-file. See below:
parameters:
- name: contentKey
displayName: Pool Image
default: contentDefaultValue
Then You can use pipeline run rest api in your website and provide the templateParameters
in the request body to override the Runtime parameters defined in your pipeline with the contents of the .xlsx-file. See below:
{
"templateParameters":{
"contentKey": "contentValue"
}
}
If you have to pass the yaml file in the pipeline. You can try to upload the yaml file to azure devops. And then download the yaml file in your pipeline. So that the pipelines steps can access the yaml file.
Below are the possible methods you can use to upload the yaml file to azure devops.
1, you can create a repository in your azure devops project to hold the yaml file. And upload the file to the repository via api in your website. See example here. See rest api here.
Then you can run git clone command
in a script task to download the file in your pipeline.
2, you can use upload the file to workitem attachment. See rest api here.
And pass the attachment id to the pipeline when your run the pipeline(you can refer to above workaround and define a Runtime parameters to hold the id value).
Then you need to call rest api to get the yaml file in a script task in your pipeline.
3, Upload the yaml file to azure devops secure file. See this thread.
Then use download secure file task to download the yaml file in your pipeline.
Hope above helps!
Update:
In yaml pipeline file. You can define your parameter as below:
parameters:
- name: paramname
type: object
displayName: 'configure path'
default:
param1: '[{\"a\":\"x\",\"b\":\"y\"},{\"a\":\"x\",\"b\":\"y\"}]'
param2: 'string1'
param3: 'string2'
In the rest api. You can pass the request body as below:
{
"templateParameters":{
"paramname": "{\"param1\":\"'[{\\'a\\':\\'x\\',\\'b\\':\\'y\\'},{\\'a\\':\\'x\\',\\'b\\':\\'y\\'}]'\",\"param2\":\"string11\", \"param3\":\"string22\"}"
}
}
Then you can access the parameter in the bash task like below:
echo "${{parameters.paramname.param1}}"
echo "${{parameters.paramname.param2}}"