diff --git a/eng/common/pipelines/templates/steps/docker-pull-image.yml b/eng/common/pipelines/templates/steps/docker-pull-image.yml index fa22df31974be..61e59884f752a 100644 --- a/eng/common/pipelines/templates/steps/docker-pull-image.yml +++ b/eng/common/pipelines/templates/steps/docker-pull-image.yml @@ -1,15 +1,19 @@ parameters: - - name: ContainerRegistryClientId - type: string - - name: ContainerRegistryClientSecret + - name: ServiceConnectionName type: string + default: azuresdkimages_container-registry - name: ImageId type: string steps: -- pwsh: | - $containerRegistry = ("${{parameters.ImageId}}" -split "\/")[0] - docker login $containerRegistry -u "${{ parameters.ContainerRegistryClientId }}" -p "${{ parameters.ContainerRegistryClientSecret }}" - displayName: Login container registry -- pwsh: | - docker pull '${{ parameters.ImageId}}' - displayName: Pull docker image ${{ parameters.ImageId }} + - 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 }}' diff --git a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml index 63856f160cec4..d989426b69dd4 100644 --- a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml +++ b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml @@ -87,8 +87,6 @@ steps: - ${{ if ne(parameters.DocValidationImageId, '') }}: - template: /eng/common/pipelines/templates/steps/docker-pull-image.yml parameters: - ContainerRegistryClientId: $(azuresdkimages-cr-clientid) - ContainerRegistryClientSecret: $(azuresdkimages-cr-clientsecret) ImageId: '${{ parameters.DocValidationImageId }}' - pwsh: | $packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"').Replace("\\", "/")