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.
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.

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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With