Ross
Ross

Reputation: 2417

Azure DevOps Release Pipeline pass in docker image tag into kubernetes configuration

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.

Artifact Selection During Create a new release:

enter image description here

Kubectl Release Task:

enter image description here

I cannot seem to pass the image that is selected at the beginning into the configuration.

Upvotes: 1

Views: 1957

Answers (1)

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30313

You can use the predefined release variable Release.Artifacts.{alias}.BuildId to get the version of the selected artifacts. See below:

image:_stars.api.web.attainment:$(Release.Artifacts._stars.api.web.attainment.BuildId)

Check here for more release variables.

Upvotes: 2

Related Questions