Deploy Azure container Instances using Azure DevOps CI/CD pipelines

git remote add origin repo-address
git push -u origin — all

Azure Devops CI Pipline

Now we will start with the first step which is create our CI pipeline we will require two tasks: the first one is related to the angular project which is the npm install task and the second one is related docker task and it will be in charge for building and pushing our image to Azure registry

# base imageFROM node:12.2.0# set working directoryWORKDIR /app# add `/app/node_modules/.bin` to $PATHENV PATH /app/node_modules/.bin:$PATH# install and cache app dependenciesCOPY package.json /app/package.jsonRUN npm installRUN npm install -g @angular/cli@7.3.9# add appCOPY . /app# start appCMD ng serve --host 0.0.0.0

Azure Devops CD Pipline

After we’ve finished pushing our image to the azure container registry, we will use the Release Pipelines to deploy it to an azure container instances.

az container create -g aci-demo --name aci-demo-app --image $(acrLoginServer)/demo-aci:11 --cpu 1 --memory 1 --registry-login-server $(acrLoginServer) --registry-username $(acrName) --registry-password $(acrPassword)  --ports 80

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store