微软DevOps& Azure功能:实施递归更新 [英] Microsoft DevOps & Azure Functions: Implement recursive updates

查看:114
本文介绍了微软DevOps& Azure功能:实施递归更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任务来实现由Microsoft DevOps(VSTS)中定义的HTTP-Webhook触发的Azure功能.

I have a task to implement an Azure Function which is triggered by an HTTP-Webhook defined in Microsoft DevOps (VSTS).

想法如下:

  • 我们有一个积压结构(比方说:史诗>功能>用户故事>任务)
  • 如果我将其中任何一项的状态设置为完成",则所有基础项也应更改为完成"

我到目前为止所做的事情

  • 我已在DevOps中启用了一个Webhook,该Webhook会在更新任何工作项时触发并将此项目作为JSON发送到Azure函数
  • 我编写了由HTTP请求调用的Azure函数,并获取了触发请求的项目的URL
    • 该函数然后获取所有属于第一个工作项的子项
    • 该函数使用第一个项目的状态修补所有找到的子项目
    • 所有直接子代都在DevOps上更新
    • I have enabled a webhook in DevOps which triggers on update of any workitem and sends this item as JSON to an Azure Function
    • I have written the Azure Function which is invoked by an HTTP-request and get's the URL of the item which has triggered the request
      • The function then gets all items which are a child of the first workitem
      • The function patches all found child items with the state of the first item
      • All direct children are updated on DevOps

      我需要什么
      我正在尝试找出启用递归更新的选项.不仅应该更新直接子代,还应该更新所有子代(如果有的话)等等. 我考虑了以下方法来完成此操作,并需要您的指导:

      What i need
      I'm trying to figure out an option to enable recursive update. Not only direct children should be updated, but also all their children (if they have some) and so on. I thought about the following ways to accomplish this and need your guidance:

      • 获取所有直接子级作为JSON,然后将所有子项传递给同一函数的HTTP请求发送给

      • Get all direct children as JSON and then send HTTP-request's to the same function, passing all child item's

      在函数中调用该函数(甚至不知道这是否可行)并将子级作为JSON传递

      call the function within the function (don't even know if this works) and pass the children as JSON

      找到一种方法来处理该单个函数中的所有逻辑(愚蠢的foreach嵌套以确保处理所有积压层次结构级别)

      find a way to handle all the logic in this single function (dumb foreach-nesting to ensure all backlog-hierarchy levels are processed)

      如果需要任何代码片段,请告诉我,我会提供所需的部分(现在我不确定我应该发布代码的哪一部分,这会有所帮助)

      If any code snippets are needed just tell me and i will provide the requested parts (right now i'm quite unsure what part of my code i should publish and would be helpful)

      推荐答案

      从您的方法列表中:

      • Get all direct children as JSON and then send HTTP-request's to the same function, passing all child item's
        [Please see Fan-Out/Fan-In scenarios in Durable functions. This will achieve what you are looking for]

      在函数内调用该函数(甚至不知道这是否有效) 并将子级作为JSON
      传递 [不建议这样做.请参阅此处以获得最佳做法]

      call the function within the function (don't even know if this works) and pass the children as JSON
      [This is not recommended. Please see here for best practices]

      在此单个函数中找到一种处理所有逻辑的方法(哑巴
      foreach嵌套以确保已处理所有积压层次结构级别) [同样在这里.不建议这样做.通常,最佳做法是避免长时间运行功能]

      find a way to handle all the logic in this single function (dumb
      foreach-nesting to ensure all backlog-hierarchy levels are processed) [Same here. This is not recommended. In general it best practice to avoid long running functions]

      这篇关于微软DevOps& Azure功能:实施递归更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆