when ACR is updated with latest images automatically pipeline need to trigger in ADO, How can I prevent this, or is there a better way of acheiving what I want? Need event triggers for ADO pipeline
Asked
Active
Viewed 1,520 times
1
-
having some doubts regarding – Arun Vijay Mar 26 '21 at 14:16
-
- container: string # identifier for the container resource,actually what we have to present here, before that we need to create acr service connection ? – Arun Vijay Mar 26 '21 at 14:18
-
please provide sample values in below code: example – Arun Vijay Mar 26 '21 at 14:19
-
You could check the examples here: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/resources?view=azure-devops&tabs=schema#resources-containers. – Cece Dong - MSFT Mar 29 '21 at 10:08
-
pipeline is not triggering when i update the acr with latest images – Arun Vijay Mar 30 '21 at 11:07
-
Have you set `trigger`? Triggers are not enabled by default and need to be set explicitly. – Cece Dong - MSFT Mar 31 '21 at 01:37
-
trigger: - none resources: containers: - container: 'myid' type: ACR azureSubscription: 'sc' resourceGroup: 'rg-eu2-t-spoke-s-app' registry: 'acreu2aks' repository: 'webfrontend' # sample app repos trigger: true pool: vmImage: 'ubuntu-latest' – Arun Vijay Mar 31 '21 at 06:01
-
above comment with exact code using in pipeline – Arun Vijay Mar 31 '21 at 06:02
-
`trigger: true` is not correct, please check the example in the following reply to set the trigger. – Cece Dong - MSFT Mar 31 '21 at 06:57
1 Answers
2
If you need to consume a container image as part of your CI/CD pipeline, you can achieve it using Resources: containers
. A container resource can be a public or private Docker Registry, or Azure Container Registry.
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 are not enabled by default and need to be set explicitly
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
For example:
resources:
containers:
- container: petStore
type: ACR
azureSubscription: ContosoARMConnection
resourceGroup: ContosoGroup
registry: petStoreRegistry
repository: myPets
trigger:
tags:
include:
- production*
or
resources:
containers:
- container: mycontainer # name of the container (Alias)
type: ACR # type of registry
azureSubscription: arm-connection # name of the ARM service connection
resourceGroup: rg-storage-eastus # Azure resource group with the container
registry: mycontainerregistry # Azure container registry name
repository: hello-world # name of the of container image collection
trigger:
tags:
- latest # tag for the container image to use

Cece Dong - MSFT
- 29,631
- 1
- 24
- 39
-
i used above code with tags latest , still am facing same its not triggering – Arun Vijay Mar 31 '21 at 07:26
-
-
Did you set the trigger as `trigger: tags: include: - production* `? – Cece Dong - MSFT Apr 01 '21 at 10:19