Pipelines

Agents

Not all agents are the same. We’ve seen that they can be based on different operating systems, but they can also install different dependencies.

To describe it, every agent has a set of capabilities configured as name-value pairs. The capabilities such as machine name and operating system type that are automatically discovered are referred to as System capabilities. The ones that you define are called User-defined capabilities.

There’s a tab for Capabilities on the Agent Pool

live action

setting up a locally hosted agent in Windows

Understanding Pipeline Structure

A pipeline is one or more stages that describe a CI/CD process.

Stages are the primary divisions in a pipeline. The stages “Build this app,” “Run these tests,” and “Deploy to preproduction” are good examples.

A stage is one or more jobs, units of work assignable to the same machine.

So we have

Stage

A stage is a collection of related jobs. By default, stages run sequentially. Each stage starts only after the preceding stage is complete.

Job

A job is a collection of steps run by an agent or on a server. Jobs can run conditionally and might depend on previous jobs.

Deployment Strategies

Deployment strategies allow you to use specific techniques to deliver updates when deploying your application.

Setting up a containerized web app in Azure DevOps

first set bunch of variables:

 RG_NAME='az400m1501a-RG'
 ACR_NAME=az400m151acr$RANDOM$RANDOM
 APP_SVC_PLAN='az400m1501a-app-svc-plan'
 WEB_APP_NAME=az400m151web$RANDOM$RANDOM
 SQLDB_SRV_NAME=az400m15sqlsrv$RANDOM$RANDOM
 SQLDB_NAME='az400m15sqldb'

and then create all the services:

 az group create --name $RG_NAME --location $LOCATION
 az acr create --name $ACR_NAME --resource-group $RG_NAME --location $LOCATION --sku Standard --admin-enabled true
 az appservice plan create --name 'az400m1501a-app-svc-plan' --location $LOCATION --resource-group $RG_NAME --is-linux
 az webapp create --name $WEB_APP_NAME --resource-group $RG_NAME --plan $APP_SVC_PLAN --deployment-container-image-name elnably/dockerimagetest
 IMAGE_NAME=myhealth.web
 az webapp config container set --name $WEB_APP_NAME --resource-group $RG_NAME --docker-custom-image-name $IMAGE_NAME --docker-registry-server-url $ACR_NAME.azurecr.io/$IMAGE_NAME:latest --docker-registry-server-url https://$ACR_NAME.azurecr.io
 az sql server create --name $SQLDB_SRV_NAME --resource-group $RG_NAME --location $LOCATION --admin-user sqladmin --admin-password Pa55w.rd1234
 az sql db create --name $SQLDB_NAME --resource-group $RG_NAME --server $SQLDB_SRV_NAME --service-objective S0 --no-wait 
 az sql server firewall-rule create --name AllowAllAzure --resource-group $RG_NAME --server $SQLDB_SRV_NAME --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0

live action

Setting up the docker pipeline in Azure DevOps

and we have our website deployed in a Docker container!