azure-sdk-for-cpp/eng/common/pipelines/templates/steps/docker-pull-image.yml
Azure SDK Bot 408bd2bead
Sync eng/common directory with azure-sdk-tools for PR 8015 (#5487)
* Use different service connection and az CLI for ACR auth

* displayName

---------

Co-authored-by: Daniel Jurek <djurek@microsoft.com>
2024-04-04 10:11:18 -07:00

20 lines
647 B
YAML

parameters:
- name: ServiceConnectionName
type: string
default: azuresdkimages_container-registry
- name: ImageId
type: string
steps:
- task: AzureCLI@2
displayName: Docker Auth and Pull
inputs:
azureSubscription: ${{ parameters.ServiceConnectionName }}
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
# azuresdkimages.azurecr.io/pyrefautocr:latest -> azuresdkimages
$containerRegistryName = ("${{ parameters.ImageId }}" -split "\/")[0].Replace(".azurecr.io", "")
az acr login --name $containerRegistryName
docker pull '${{ parameters.ImageId }}'