az ad sp create-for-rbac --skip-assignment
az role assignment create --assignee 626dd8ea-042d-4043-a8df-4ef56273670f --role Contributor --scope $ACR_ID
apt-get azure-cli
az login
az acr create --resource-group registry-rg --name registry --sku Standard --location eastus
az acr build --registry registry --image namewithtag:v1 .
azure-pipelines.yml
file.Or you can create the yaml file yourself using Docker task:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build job
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)