<p>I have a build pipeline that builds my docker image and pushes it to my docker registry. I am trying to create a release pipeline to pull that image from the registry and deploys it to my staging environment which is a Azure Kubernetes Cluster. This release pipeline works to the point I see deployment, pods, and services in the cluster after it has run. However, I'm struggling to pass in the image that is select from the artifact selection before you run the release pipeline.</p>
<p>Artifact Selection During <code>Create a new release</code>:</p>
<p><a href="https://i.stack.imgur.com/y0UPH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y0UPH.png" alt="enter image description here" /></a></p>
<p><code>Kubectl</code> Release Task:</p>
<p><a href="https://i.stack.imgur.com/soJfT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/soJfT.png" alt="enter image description here" /></a></p>
<p>I cannot seem to pass the image that is selected at the beginning into the configuration.</p>

<p>You can use the predefined release variable <code>Release.Artifacts.{alias}.BuildId</code> to get the version of the selected artifacts. See below:</p>
<pre><code>image:_stars.api.web.attainment:$(Release.Artifacts._stars.api.web.attainment.BuildId)
</code></pre>
<p>Check <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&amp;tabs=batch#default-variables---general-artifact" rel="nofollow noreferrer">here</a> for more release variables.</p>
