Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to indicate an azureSubscriptionEndpoint in docker v2

I am updating an azure pipelines push.yml file. It contains code written in Docker v1 which I need to upgrade to Docker v2. In Docker v1, one of the inputs parameters is "azureSubscriptionEndpoint". However, in the documentation of azure pipelines, which shows Docker v2 documentation only, I see no mention of this parameter. However, this parameter contains the name of the azure subscription, which I presume is essential information for azure. Is there some other way this needs to be specified in Docker v2. By the way, I am an absolute beginner in this, so excuse me if any of my terminology is incorrect.

like image 890
didjek Avatar asked Dec 18 '25 21:12

didjek


1 Answers

If you use this Docker task, now its latest version is 2. Its Docker Registry paramater requires that you create a new Docker Registry service connection. enter image description here

If you choose Azure Container Registry as the Registry type, so you need to have an available Azure subscription, which is the value of the azureSubscriptionEndpoint parameter in previous Docker v1 and it also is the name of Azure Resource Manager service connection.

- task: Docker@1
  displayName: buildAndPush
  inputs:
    azureSubscriptionEndpoint: 'xxx'
    azureContainerRegistry: edwardregistery.azurecr.io
    command: buildAndPush

Therefore, if you use Docker v2 in push.yml file, the corresponding syntax should be

- task: Docker@2
  inputs:
    containerRegistry: 'the name of Docker Registry service connection'
    repository: 'the name of the container repository.'
    command: 'buildAndPush'
    Dockerfile: '**/Dockerfile'

You could use classic editor to view the details. And azure-pipelines-tasks lists the source code.

like image 133
Edward Han-MSFT Avatar answered Dec 20 '25 14:12

Edward Han-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!