ACR Tasks triggers for code, base image, and scheduled rebuilds

AI-200 By islever Editorial Last updated

Short answer

ABD Configure a timer trigger for scheduled rebuilds, a source code commit trigger for application updates, and a base image update trigger for base image or OS image changes in ACR Tasks.

Question

You configure ACR Tasks to automate image builds. Container images must rebuild when application updates occur, when base image updates occur (such as when the underlying OS image is updated), and on regular scheduled rebuilds. You need to configure ACR Tasks to support automated image rebuilds. Which three triggers should you configure? Each correct answer presents part of the solution.
  1. Timer trigger Correct Answer
  2. Source code commit trigger Correct Answer
  3. Registry event trigger
  4. Base image update trigger Correct Answer
  5. Webhook notification trigger

Key Takeaways

ACR Tasks automated rebuilds use three trigger types: source code commit for application changes, base image update for changed parent or OS images, and timer for scheduled runs. The correct set is A, B, and D because each trigger maps to one stated rebuild condition, while registry event and webhook notification choices do not start ACR task runs.

Expert Analysis

The three rebuild conditions — application code changes, dependent base-image refreshes, and a fixed cadence — map one-to-one to ACR Tasks' source commit, base image update, and timer triggers, so the correct trio is A, B, and D.

ACR Tasks' documented trigger model admits only source, base-image, and schedule inputs

Azure Container Registry Tasks is the registry-native build service that runs a task's steps in a temporary build agent, and its automated execution contract is deliberately narrow. A task definition carries a source trigger for a Git repository, a base image update trigger for dependencies discovered from an earlier successful run, and one or more timer triggers expressed as cron schedules. The source trigger listens for commit events from GitHub or Azure Repos. The base image update trigger is not a generic rule that fires whenever anything changes in the registry; it follows the base images recorded for that task and activates when one of those tracked images is refreshed. Timer triggers use a cron expression and can be enabled or disabled independently of the other two. The ACR Tasks CLI exposes the model through options such as --commit-trigger-enabled, --base-image-trigger-enabled, and --schedule, while the YAML task definition groups the settings under a trigger block containing sourceTrigger, baseImageTrigger, and timerTriggers. Registry webhooks and Event Grid subscriptions sit outside that trigger block and serve notification or integration scenarios. Consequently, the only three automated rebuild inputs that can satisfy a requirement set spanning code changes, base-image changes, and scheduled runs are the source commit trigger, the base image update trigger, and the timer trigger.

Application updates and OS-image refreshes each satisfy a distinct trigger condition

The workload names three independent causes of a rebuild, and each cause has a different causal input rather than a different registry operation. An application update is a change to the source repository, so the commit event is the signal that must start the build; a source code commit trigger is the only option that listens at that point. The requirement that the rebuild follow an underlying OS image update is explicitly a dependency change on a base image, which is what the base image update trigger tracks. The requirement for regular rebuilds is a cadence requirement, not an event requirement, and only the timer trigger accepts a schedule. Mapping those three inputs to the answer set yields A, B, and D. The other two choices do not correspond to any named cause: a registry event trigger would react to registry-level activity, and a webhook notification trigger would send or receive a notification. Because the solution must cover exactly the three stated rebuild causes, adding either of those would introduce a trigger whose condition is not part of the requirement.

Registry events and webhook notifications are outputs or platform signals, not ACR task build starts

The confusion around C and E comes from the fact that Azure Container Registry can emit push and delete events, and webhooks genuinely exist in the service. A registry event records that an operation happened in the registry, typically an image push or delete, and it can be routed to Event Grid or delivered to an ACR webhook. That event does not know whether the artifact is the application image, a base image used by a task, or an unrelated helper repository. The base image update trigger is narrower: it uses the base image references recorded from the task's own build and fires only when that dependency changes. Pushing a diagnostic image to a different repository can therefore produce a registry event without any justification for rebuilding the application. A webhook notification trigger is an outbound HTTP callback made after a registry event; it is a consumer of the event, not a producer of task runs. An external endpoint that receives the webhook could call the ACR Tasks API, but the webhook itself does not start a build. That boundary is why C and E sound automation-related yet cannot substitute for the source, base-image, or timer triggers.

Trigger evaluation queues a task run before the build steps execute

In ACR Tasks, the decisive stage is not the Dockerfile layer rebuild but the earlier moment when a trigger condition evaluates true and ACR creates a task run. The source trigger maintains a subscription to the Git repository; a qualifying commit causes the registry to enqueue a run. The base image trigger compares a refreshed base image against dependencies recorded from a prior successful task run; when the tracked dependency matches, ACR queues a new run. The timer trigger evaluates its cron expression and enqueues a run at the appointed time. Only after one of those run-creation paths succeeds does the build agent execute the task's steps. The trigger does not edit the Dockerfile, invalidate every cached layer, or push an image by itself; it schedules the work that does those things. This is why disabling any one trigger leaves a real gap: with the base image trigger off, a base-image refresh waits until the next code commit; with the source trigger off, an application change waits for some other run; with the timer off, the regular cadence simply disappears. The baseImageTrigger must also be enabled and set to the appropriate dependency-tracking type, because a disabled or misconfigured trigger never reaches the run-queue stage at all.

Exam Strategy

Read the rebuild causes as separate trigger inputs before evaluating any option: application code maps to source commit, a dependent OS or base image maps to base image update, and a recurring cadence maps to timer. Eliminate choices that describe notification or generic registry activity, because an outbound webhook and a registry event do not enqueue an ACR task run. When the stem says each answer is part of the solution, verify that the selected letters cover every named cause and no extra condition.

Practice All AI-200 Questions

Access 69 questions with complete answers and detailed explanations.

View Full AI-200 Practice Test →

← Back to AI-200 Study Guide