Derive the ACR name from a Service Connection in Azure Devops pipeline?

Viewed 68

I have a series of build pipelines in Azure Devops that use the Docker@2 task to buildAndPush an image from a Dockerfile into our Azure Container Registry. The pipeline needs a Service Connection for the ACR, but at the moment I also supply the FQDN for the same ACR as a variable, so that the image can be tagged and pushed correctly.

In the interests of DRY, is there any way to access the Service Connection and extract this information instead? I haven't found much information about what adding a Service Connection actually does on the build agent - presumably there is some file of credentials/properties created somewhere...

0 Answers
Related