A team registers an Azure Kubernetes Service cluster as a resource inside a "production" environment in "Azure Pipelines", then writes a deployment job that targets that specific resource within the environment. They want the approvals and checks they configured on the environment to apply, while the job acts only against that registered cluster. How should the deployment job reference the target so both conditions hold?
jobs:
- deployment: RolloutWeb
environment:
name: production
resource: aks-prod-cluster
strategy:
runOnce:
deploy:
steps:- ASpecify both the environment name and the registered resource under the deployment job's environment block, so checks apply and the job binds to that cluster resource. Correct
- BReference the environment by name only and omit the resource, then add a manual step inside the job that runs kubectl against the chosen cluster context.
- CReference the cluster resource alone without naming the environment, relying on the resource registration to carry the approvals and checks across to the job.
- DUse a standard job with a service connection to the cluster, since deployment jobs cannot target an individual registered resource within an environment.
Why A is correct: Giving the environment name plus the resource binds the deployment job to the registered Kubernetes resource while still subjecting the run to the environment's approvals and checks, satisfying both conditions.
Why B is wrong: Naming the environment alone still triggers its checks, but omitting the resource means the job is not scoped to the registered cluster, so a scripted context switch loses the resource binding the team wants.
Why C is wrong: This is tempting because the resource lives inside the environment, but the deployment job must name the environment for its checks to bind; a resource reference without the environment name does not attach environment-level approvals.
Why D is wrong: Deployment jobs can target a resource inside an environment, and a standard job bypasses the environment entirely, so its approvals and checks would never run on the deployment.