What is a Docker registry service connection?
Asked Answered
P

4

26

Following this documentation, Docker registry service connection is found in the following YAML. What is Docker registry service connection and where can it be found?

trigger:
- master

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: <Docker registry service connection>
  imageRepository: <Name of your image repository>
  containerRegistry: <Name of the Azure container registry>
  dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
  tag: '$(Build.BuildId)'

  # Agent VM image name
  vmImageName: 'ubuntu-latest'

- task: AzureWebAppContainer@1 # Add this at the end of your file
  inputs:
    azureSubscription: '<Azure service connection>'
    appName: '<Name of the container web app>'
    containers: $(containerRegistry)/$(imageRepository):$(tag)
Pomegranate answered 21/12, 2019 at 20:43 Comment(0)
R
33

A service connection is a connector to an external service (see here). A Docker registry service connection basically is a connector to a Docker registry. You can set it here:

Azure Devops project home Azure devops project settings add service connection

Rhaetia answered 22/12, 2019 at 2:47 Comment(0)
G
16

mmking's answer covers the what part of the question, but not where can it be found.

After adding a "Docker Registry" service connection, select it from the list of service connections. The url will look something like:

https://your-org.visualstudio.com/YourProject/_settings/adminservices?resourceId=0b6c0705-9fbb-40ec-b629-95cd92856257

Take the resourceId from the query string, which is "0b6c0705-9fbb-40ec-b629-95cd92856257" in the above example, and use it as the dockerRegistryServiceConnection value.

Googol answered 25/5, 2021 at 2:12 Comment(2)
This solved my issue together with above answer! Thanks dudeBryant
Perfect, this was the missing piece.Reganregard
P
3

One of the many connection types connection predefined by Microsoft; Read through their documentation: Service connections, you will definitely get a grasp that will answer your question.

Peppard answered 9/1, 2020 at 15:52 Comment(0)
L
0

There are three different container registry types : Docker Hub, Others and Azure Container Registry. I managed to connect to my Azure Container Registry - ACR - created for my subscription. I have created the ACR in Azure Portal via Project Settings => Azure Pipelines : Service Connections . If you see the ACR you in the Azure Portal you find username and password via Access Keys tab.

Add service connection via : Docker Registry option. You can choose ACR also here as the type. Actually, I got it also working via the Other option in the dialog showing the connection to Docker Registry.

The Service Connection name must agree with the value of the containerRegistry in the YAML, if you rerun the Pipeline in Azure you should find the container registry.

Setting up Docker Registry Service Connection

Logogram answered 4/8, 2023 at 16:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.