如何将ACR与Azure devops管道连接,以便在ACR Azure devops管道中有新映像时触发

f4t66c6m  于 2023-01-27  发布在  其他
关注(0)|答案(1)|浏览(121)

如何连接ACR与Azure devops管道,以便每当ACR Azure devops管道中有新映像时触发。Webhook是一个选项,但如何设置它,需要指定发送发布通知的URI,然后如何在Devops管道中使用Webhook。提前感谢
我试过在acr中创建webhook,但不确定发布通知使用什么URI,以及Azure devops服务钩子中应该给出什么URI。另外,如何在yaml文件中声明此

rkttyhzu

rkttyhzu1#

您可以定义容器资源并将trigger参数设置为true,如本文文档中所述。
来自文档:

resources:          # types: pipelines | repositories | containers | builds | packages
  containers:
  - container: string # identifier for the container resource      
    type: string # type of the registry like ACR, GCR etc. 
    azureSubscription: string # Azure subscription (ARM service connection) for container registry;
    resourceGroup: string # resource group for your ACR
    registry: string # registry for container images
    repository: string # name of the container image repository in ACR
    trigger: # Triggers aren't enabled by default and need to be set explicitly
      enabled: boolean # set to 'true' to trigger on all image tags if 'tags' is unset.
      tags:
        include: [ string ]  # image tags to consider the trigger events, optional; defaults to any new tag
        exclude: [ string ]  # image tags on discard the trigger events, optional; defaults to none

相关问题