我正在尝试使用 VSTS 发布管道门功能在部署后测试新的 Azure 函数。 我已经尝试了“调用 Azure 函数”和“调用 REST API”部署门,但无法让它们成功。
如果收到简单的 HTTP 200 或 202 响应,我只想调用端点并让 gate 成功。
最近的努力是将其放入“成功标准”字段中
eq(count(jsonpath('$.responses[?(@.httpStatusCode != 200)]')), 1)
Processing Gate 步骤只是说“还没有样本到达”并且没有日志。
有人成功过吗?有什么想法吗?
最佳答案
“Invoke Azure function”任务遇到了同样的问题,如果您只需要检查它是否为 200
,则无需指定“Success criteria”总之,它开箱即用。我希望它与 202
相同。
their documentation 中提到了它,但像往常一样,您应该仔细阅读字里行间之类的内容。
Completion Event - How the task reports completion. Can be API response (the default) - completion is when function returns success and success criteria evaluates to true, or Callback - the Azure function makes a callback to update the timeline record.
Success criteria - How to parse the response body for success.
关于azure-devops - VSTS 发布 HTTPS 状态 200 的管道门成功标准,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52280241/