Microsoft流队列Devops管道-必须提供参数

时间:2020-07-31 03:56:54

标签: azure-pipelines power-automate

我正在尝试使用Flow使管道排队。

管道具有以下参数:

# Pipeline Trigger
trigger:
- none

# Use parameters as input options
parameters:
- name: location
  displayName: Location?
  type: string
  values:
    - australiaeast
    - uksouth
    - eastus
    - westus2
    - southeastasia

流程:

enter image description here

我得到一个错误:

Could not queue the build because there were validation errors or warnings.
Azure DevOps ActivityId: <id>
Details: {"ClassName":"Microsoft.TeamFoundation.Build.WebApi.BuildRequestValidationFailedException","Message":"Could not queue the build because there were validation errors or warnings.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":null,"RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2146232832,"Source":null,"WatsonBuckets":null,"m_logException":false,"m_reportException":false,"m_errorCode":0,"m_logLevel":"warning","m_eventId":3000,"ValidationResults":[{"result":"error","message":"A value for the 'location' parameter must be provided."}

JSON应该没问题。是否打算以此方式工作?要将参数传递给管道参数?

2 个答案:

答案 0 :(得分:1)

您的参数应采用以下格式:

[
  {
    "location":"australiaeast"
  }
]

答案 1 :(得分:0)

实际上,

[
  {
    "location":"australiaeast"
  }
]

给我“错误的网关”

这确实有效:

{
"location":"uksouth"
}

问题是其他一些参数没有在管道中设置默认值。给他们提供默认值后,我就可以传递参数了。