I've been trying to pull a service container from AWS ECR in azure pipeline but I'm not sure how to perform the "aws ecr get-login" from the pipeline.yml. Here is what I have in my azure pipeline.yml but of course I'm getting "no basic auth credentials" error. Can anyone shed some lights on how to pull image from AWS ECR in azure pipeline service container ?
resources:
containers:
- container: sqlDB
image: 1511260612345.dkr.ecr.ap-southeast-2.amazonaws.com/sqlDB:latest
options: --name myDB
env:
ACCEPT_EULA: Y
SA_PASSWORD: myPass123!
services:
sql_db: sqlDB
I have also tried to connect to the AWS endpoint but stupidly azure pipeline only allows docker registry and its own azure container registry.
"The pipeline is not valid. Expected 'dockerregistry' service connection type for image registry referenced by sqlDB, but got AWS for service connection aws_test."
Your pipeline is correct and what mentioned by @4c74356b41 by adding "endpoint" is also correct.
Following is the Step by step instructions:
aws ecr get-login --no-include-email --region [enter you region here]
or if you have aws profile
aws ecr get-login --no-include-email --profile [enter your aws profile] --region [enter you region here]
The copy the password section (after "-p") from the above output (you will need to paste it in the docker registry below).