Home
%3CLINGO-SUB%20id%3D%22lingo-sub-359569%22%20slang%3D%22en-US%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%203%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-359569%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%3CEM%3EIf%20you%20missed%20the%20previous%20parts%20they%20can%20be%20found%20here%3A%26nbsp%3B%3CBR%20%2F%3E%3CA%20title%3D%22Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%201%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Developer-Community-Blog%2FBuilding-Microservices-with-Azure-Kubernetes-Service-and-Azure%2Fba-p%2F356402%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%201%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Developer-Community-Blog%2FBuilding-Microservices-with-Azure-Kubernetes-Service-and-Azure%2Fba-p%2F359965%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%202%3C%2FA%3E%3C%2FEM%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBy%20now%20you%20should%20have%20a%20cluster%20running%2C%20as%20well%20as%20the%20rest%20of%20the%20basics.%20But%20you%20need%20a%20way%20for%20the%20code%20to%20move%20from%20your%20desktop%20to%20the%20cluster.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1709325713%22%20id%3D%22toc-hId-1731630615%22%20id%3D%22toc-hId-1731630615%22%20id%3D%22toc-hId-1731630615%22%3E%3CSPAN%3ECreating%20a%20Continuous%20Integration%20(CI)%20Pipeline%20in%20Azure%20DevOps%3C%2FSPAN%3E%3C%2FH2%3E%3CP%3E%3CSPAN%3EOne%20of%20the%20major%20points%20of%20doing%20microservices%20and%20containers%20is%20avoiding%20the%20%E2%80%9Cit%20works%20on%20my%20machine.%20While%20containers%20are%20a%20vehicle%20for%20achieving%20this%2C%20we%20also%20need%20a%20vehicle%20for%20carrying%20the%20container%20from%20the%20developer%20workstation%20to%20other%20machines.%20In%20this%20guide%20that%20vehicle%20is%20%3CEM%3EAzure%20DevOps%3C%2FEM%3E%2C%20the%20artist%20formerly%20known%20as%20%3CEM%3EVisual%20Studio%20Team%20Services%3C%2FEM%3E%20(VSTS).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EDevOps%20as%20a%20term%20encompasses%20more%20than%20just%20the%20technical%20pieces%2C%20but%20this%20guide%20will%20focus%20only%20on%20a%20few%20isolated%20components.%20The%20first%20part%20is%20Continuous%20Integration%20(CI)%20which%20handles%20building%20of%20the%20code%2C%20and%20the%20second%20part%20is%20Continuous%20Deployment%20(CD)%20which%20is%20about%20deploying%20the%20code%20built%20by%20CI.%20CD%20will%20be%20covered%20in%20the%20next%20section.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ELet%E2%80%99s%20start%20by%20creating%20a%20new%20%3CEM%3EDockerfile%3C%2FEM%3E%20specifically%20for%20CI.%20Add%20a%20new%20file%20called%20%3CEM%3EDockerfile.CI%3C%2FEM%3E%20with%20the%20following%20contents%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3EFROM%20microsoft%2Fdotnet%3A2.2-sdk%20AS%20build-env%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EWORKDIR%20%2Fapp%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%23%20Copy%20csproj%20and%20restore%20as%20distinct%20layers%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ECOPY%20*.csproj%20.%2F%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ERUN%20dotnet%20restore%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%23%20Copy%20everything%20else%20and%20build%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ECOPY%20.%20.%2F%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ERUN%20dotnet%20publish%20-c%20Release%20-o%20out%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%23%20Build%20runtime%20image%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EFROM%20microsoft%2Fdotnet%3A2.2-sdk%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EWORKDIR%20%2Fapp%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ECOPY%20--from%3Dbuild-env%20%2Fapp%2Fout%20.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EENTRYPOINT%20%5B%22dotnet%22%2C%20%22AKS-Web-App.dll%22%5D%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EYou%20will%20notice%20that%20Visual%20Studio%20arranges%20it%20as%20a%20child%20node%20under%20the%20existing%20%3CEM%3EDockerfile%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWe%20want%20to%20use%20%3CEM%3EHelm%3C%2FEM%3E%20for%20packaging%20and%20deploying%2C%20and%20for%20this%20we%20need%20a%20helm%20chart.%20Create%20a%20default%20by%20executing%20the%20command%20below%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20513px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86346iFC935621CD5F5ABC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Helm_02.png%22%20title%3D%22Helm_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2034%20Creating%20a%20default%20helm%20chart%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIt%20is%20worth%20mentioning%20that%20there%20is%20an%20extension%20currently%20in%20preview%20for%20%3CEM%3EVisual%20Studio%3C%2FEM%3E%20called%20%3CEM%3EVisual%20Studio%20Tools%20for%20Kubernetes%3C%2FEM%3E%20that%20will%20automate%20this%20step%20for%20you.%20It%20is%20recommended%20to%20check%20this%20out%2C%20but%20for%20a%20deeper%20understanding%20this%20guide%20has%20chosen%20to%20not%20use%20this%20extension.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhy%20Helm%20is%20needed%20might%20not%20be%20clear%20at%20this%20point%2C%20but%20it%20adds%20a%20few%20extra%20configuration%20abilities.%20The%20following%20is%20a%20recap%20of%20the%20configuration%20files%20for%20a%20service%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3EDockerfiles.%20These%20describe%20a%20single%20container%20with%20low-level%20details%20like%20base%20image%2C%20port%20openings%2C%20etc.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EDocker-Compose.%20These%20describe%20a%20collection%20of%20containers%20that%20logically%20belong%20together.%20For%20example%2C%20having%20both%20a%20database%20container%20and%20an%20API%20container.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EHelm%20charts.%20These%20typically%20describe%20additional%20metadata%20for%20the%20services%2C%20like%20the%20external%20url%2C%20the%20number%20of%20replicas%2C%20etc.%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%3EWhile%20it%20is%20not%20a%20requirement%20to%20use%20all%20three%20levels%20of%20configuration%2C%20it%20does%20make%20some%20things%20easier.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20default%20helm%20chart%20will%20actually%20not%20deploy%20the%20code%20you%20have%20in%20your%20VS%20solution%2C%20but%20instead%20an%20nginx%20container%20so%20a%20few%20adjustments%20will%20be%20needed.%20The%20helm%20charts%20have%20a%20templating%20system%2C%20but%20the%20important%20parts%20are%20in%20the%20%3CEM%3Evalues.yaml%3C%2FEM%3E%20file.%20A%20simple%20file%20for%20this%20service%20would%20look%20like%20this%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%23%20This%20is%20a%20YAML-formatted%20file.%3CBR%20%2F%3E%23%20Declare%20variables%20to%20be%20passed%20into%20your%20templates.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EreplicaCount%3A%201%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eimage%3A%3CBR%20%2F%3Erepository%3A%20aksdotnetacr.azurecr.io%2Faksdotnetcoder%3CBR%20%2F%3Etag%3A%20latest%3CBR%20%2F%3EpullPolicy%3A%20IfNotPresent%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EnameOverride%3A%20%22%22%3CBR%20%2F%3EfullnameOverride%3A%20%22%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eservice%3A%3CBR%20%2F%3Etype%3A%20ClusterIP%3CBR%20%2F%3Eport%3A%2080%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eingress%3A%3CBR%20%2F%3Eenabled%3A%20false%3CBR%20%2F%3Eannotations%3A%20%7B%7D%3CBR%20%2F%3Epath%3A%20%2F%3CBR%20%2F%3Ehosts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20%3C%2FSPAN%3E%3CSPAN%3Eaksdotnetcoder%3CBR%20%2F%3Etls%3A%20%5B%5D%3CBR%20%2F%3E%23%20-%20secretName%3A%20chart-example-tls%3CBR%20%2F%3E%23%26nbsp%3B%26nbsp%3B%20hosts%3A%3CBR%20%2F%3E%23%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20chart-example.local%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Eresources%3A%20%7B%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EnodeSelector%3A%20%7B%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Etolerations%3A%20%5B%5D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Eaffinity%3A%20%7B%7D%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECheck%20in%20your%20code%20and%20return%20to%20the%20Azure%20DevOps%20Portal.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20835px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86347iF51FEE8527B105F1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_01.png%22%20title%3D%22AzureDevOps_CI_01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2035%20Azure%20DevOps%20Build%20Pipelines%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20you%20go%20to%20%3CEM%3EPipelines%20%3D%26gt%3B%20Build%3C%2FEM%3E%20you%20will%20have%20a%20rather%20blank%20space%2C%20so%20click%20%3CEM%3ENew%20pipeline%3C%2FEM%3E%20to%20get%20started.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20696px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86348iA274B81BB2DA1CB1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_02.png%22%20title%3D%22AzureDevOps_CI_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2036%20Azure%20DevOps%20Build%20Pipelines%20Step%201%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ESince%20the%20code%20is%20already%20checked%20into%20Azure%20Repos%20that%20will%20be%20the%20logical%20choice.%20In%20the%20next%20step%20choose%20%3CEM%3EEmpty%20job%3C%2FEM%3E%20as%20the%20template.%20There%20are%20default%20templates%20for%20Kubernetes%2C%20but%20there%20is%20a%20lack%20of%20visibility%20of%20what%20goes%20into%20them%20before%20firing%20it%20up%2C%20so%20this%20guide%20builds%20them%20manually%20by%20starting%20from%20scratch.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20236px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86349i8D22FB1550BEF4D5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_03.png%22%20title%3D%22AzureDevOps_CI_03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2037%20Azure%20DevOps%20Build%20Pipelines%20Step%202%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EGive%20the%20pipeline%20a%20name%20and%20select%20%3CEM%3EHosted%20Linux%3C%2FEM%3E%20as%20the%20agent%20pool.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20279px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86350i096DA0EBE02EBCB6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_04.png%22%20title%3D%22AzureDevOps_CI_04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2038%20Azure%20DevOps%20Build%20Pipelines%20Step%203%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EStart%20by%20adding%20two%20%3CEM%3EDocker%3C%2FEM%3E%20tasks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20923px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86351i727140DD1AFF9DD1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_05.png%22%20title%3D%22AzureDevOps_CI_05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2039%20Azure%20DevOps%20Build%20Pipelines%20Step%204%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20first%20Docker%20task%20is%20building%20the%20image.%20Select%20the%20Azure%20subscription%20and%20the%20Azure%20Container%20Registry%20created%20previously.%20Check%20the%20boxes%20as%20seen%20in%20the%20image%2C%20and%20make%20sure%20to%20add%20%3CEM%3E%24(Build.BuildID)%3C%2FEM%3E%20as%20additional%20image%20tags.%20If%20this%20task%20looks%20differently%20for%20you%20it%20might%20be%20that%20the%20Docker%20version%20has%20defaulted%20to%20%3CEM%3E1.*%3C%2FEM%3E%20whereas%20this%20sample%20uses%20%3CEM%3E0.*%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86352iF65F785D9D8483F7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_06.png%22%20title%3D%22AzureDevOps_CI_06.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2040%20Azure%20DevOps%20Build%20Pipelines%20Step%205%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20second%20Docker%20task%20is%20about%20pushing%20the%20image%20to%20ACR.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86353i9936A3DCA71DB7F1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_07.png%22%20title%3D%22AzureDevOps_CI_07.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2041%20Azure%20DevOps%20Build%20Pipelines%20Step%206%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ENext%20up%20is%20adding%20the%20necessary%20%3CEM%3EHelm%3C%2FEM%3E%20tasks.%20Add%20one%20%3CEM%3Einstaller%3C%2FEM%3E%2C%20and%20two%20%3CEM%3Epackage%20and%20deploy%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20578px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86354i44C2EF3CC5353471%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_08.png%22%20title%3D%22AzureDevOps_CI_08.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2042%20Azure%20DevOps%20Build%20Pipelines%20Step%207%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EVersion%202.12.3%20is%20the%20latest%20at%20the%20time%20of%20writing%2C%20but%20it%20will%20automatically%20check%20each%20time%20it%20runs%20for%20new%20versions.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20282px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86355iCDDA56FE41FBDF2D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_09.png%22%20title%3D%22AzureDevOps_CI_09.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2043%20Azure%20DevOps%20Build%20Pipelines%20Step%208%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20first%20Helm%20task%20is%20a%20%3CEM%3Ehelm%20init%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20379px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86356i33832C589F040600%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_10.png%22%20title%3D%22AzureDevOps_CI_10.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2044%20Azure%20DevOps%20Build%20Pipelines%20Step%209%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20second%20Helm%20task%20is%20%3CEM%3Ehelm%20package%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20328px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86357iB916543A477B7F06%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_11.png%22%20title%3D%22AzureDevOps_CI_11.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2045%20Azure%20DevOps%20Build%20Pipelines%20Step%2010%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ETo%20wrap%20up%20the%20build%20process%20it%20is%20necessary%20to%20add%20a%20%3CEM%3EPublish%20Build%20Artifacts%3C%2FEM%3E%20task.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20927px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86358i594966382AC17EAE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_12.png%22%20title%3D%22AzureDevOps_CI_12.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2046%20Azure%20DevOps%20Build%20Pipelines%20Step%2011%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ETo%20simplify%20things%20during%20deploy%20add%20%3CEM%3E%24(Build.BuildId)%3C%2FEM%3E%20to%20the%20artifact%20name.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20257px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86359iD1081E5A5845D5B2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_13.png%22%20title%3D%22AzureDevOps_CI_13.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2047%20Azure%20DevOps%20Build%20Pipelines%20Step%2012%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThis%20should%20make%20the%20final%20CI%20Pipeline%20similar%20to%20the%20following%20screenshot%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20631px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86361i16A600D8E0AB24E1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_14.png%22%20title%3D%22AzureDevOps_CI_14.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2048%20Azure%20DevOps%20Build%20Pipelines%20Step%2013%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ETo%20finish%20the%20CI%20process%20click%20%3CEM%3ESave%20%26amp%3B%20Queue%3C%2FEM%3E%20to%20trigger%20a%20build.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20283px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86362i7AE082F890BCCA8F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_15.png%22%20title%3D%22AzureDevOps_CI_15.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2049%20Azure%20DevOps%20Build%20Pipelines%20Step%2014%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAdd%20some%20comments%20if%20you%20like%2C%20or%20just%20click%20%3CEM%3ESave%20%26amp%3B%20Queue%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20679px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86363i25EC430393DC55D8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_16.png%22%20title%3D%22AzureDevOps_CI_16.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2050%20Azure%20DevOps%20Build%20Pipelines%20Step%2015%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20everything%20passes%20with%20flying%20colors%20it%20should%20be%20all%20green%20checkmarks.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20430px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86364iB98F71D9DDB72A9C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CI_17.png%22%20title%3D%22AzureDevOps_CI_17.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2051%20Azure%20DevOps%20Build%20Pipelines%20Step%2016%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20the%20results%20are%20satisfactory%20move%20on%20to%20building%20the%20CD%20pipeline%20by%20clicking%20%3CEM%3ERelease%3C%2FEM%3E%20in%20the%20header%20above%20the%20output.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId--842831248%22%20id%3D%22toc-hId--820526346%22%20id%3D%22toc-hId--820526346%22%20id%3D%22toc-hId--820526346%22%3E%3CSPAN%3ECreating%20a%20Continuous%20Deployment%20(CD)%20Pipeline%20in%20Azure%20DevOps%3C%2FSPAN%3E%3C%2FH2%3E%3CP%3E%3CSPAN%3EA%20dev%20might%20be%20more%20than%20happy%20to%20see%20the%20CI%20pipeline%20finish%20in%20the%20green%2C%20but%20code%20that%20compiles%20isn%E2%80%99t%20worth%20much%20if%20you%E2%80%99re%20not%20able%20to%20deploy%20it%2C%20so%20the%20next%20part%20is%20about%20building%20a%20second%20pipeline%20to%20take%20care%20of%20that.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EGo%20to%20%3CEM%3EBuilds%20%3D%26gt%3B%20Releases%3C%2FEM%3E%20and%20create%20a%20new%20pipeline.%20This%20time%20also%20choosing%20the%20%3CEM%3EEmpty%20job%3C%2FEM%3E%20template.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20314px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86366iF62A65A3AED3E518%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_01.png%22%20title%3D%22AzureDevOps_CD_01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2052%20Azure%20DevOps%20Release%20Pipelines%20Step%201%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ELeave%20%3CEM%3EStage%201%3C%2FEM%3E%20with%20the%20defaults.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20252px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86367i3A9F5E391D3B4372%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_02.png%22%20title%3D%22AzureDevOps_CD_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2053%20Azure%20DevOps%20Release%20Pipelines%20Step%202%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ESince%20you%20started%20based%20on%20a%20build%20pipeline%20you%20will%20already%20have%20an%20artifact%20step%20in%20addition%20to%20a%20stage.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20653px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86370i6EF7A759C9C5F821%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_03.png%22%20title%3D%22AzureDevOps_CD_03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2054%20Azure%20DevOps%20Release%20Pipelines%20Step%203%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EMake%20sure%20that%20the%20artifacts%20look%20right%20and%20are%20linked%20to%20the%20build%20pipeline.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20235px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86371iE99432DCA740CC28%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_04.png%22%20title%3D%22AzureDevOps_CD_04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2055%20Azure%20DevOps%20Release%20Pipelines%20Step%204%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EGo%20to%20Stage%201%20and%20add%20one%20%3CEM%3Ehelm%20installer%3C%2FEM%3E%20and%20two%20%3CEM%3Ehelm%20charts%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20596px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86372i40632F4B9ABF209D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_05.png%22%20title%3D%22AzureDevOps_CD_05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2056%20Azure%20DevOps%20Release%20Pipelines%20Step%205%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EInstall%20the%20latest%20helm%20version.%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20282px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86373i51308EF1AEA35D40%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_06.png%22%20title%3D%22AzureDevOps_CD_06.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2057%20Azure%20DevOps%20Release%20Pipelines%20Step%206%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20first%20%3CEM%3Ehelm%3C%2FEM%3E%20task%20is%20a%20%3CEM%3Ehelm%20init%3C%2FEM%3E.%20This%20has%20a%20twist%20though.%20Instead%20of%20using%20the%20%3CEM%3EAzure%20Resource%20Manager%3C%2FEM%3E%20connection%20type%2C%20(used%20in%20the%20CI%20pipeline)%2C%20it%20is%20required%20to%20use%20a%20%3CEM%3EKubernetes%20Service%20Connection%3C%2FEM%3E.%20(This%20is%20due%20to%20RBAC%20being%20enabled.)%20This%20screenshot%20shows%20the%20result%2C%20but%20initially%20you%20need%20to%20click%20%3CEM%3E%2BNew%3C%2FEM%3E%20to%20create%20the%20connection.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86374i3C760F678D9E04A5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_07.png%22%20title%3D%22AzureDevOps_CD_07.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2058%20Azure%20DevOps%20Release%20Pipelines%20Step%207%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EChoose%20%3CEM%3EService%20account%3C%2FEM%3E%20as%20authentication%20method.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20587px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86375iED6D2B3488D29E3B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AKS_Service_Connection_01.png%22%20title%3D%22AKS_Service_Connection_01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2059%20Azure%20DevOps%20Release%20Pipelines%20Step%208%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20server%20URL%20can%20be%20found%20by%20browsing%20to%20the%20AKS%20deployment%20in%20the%20Azure%20Portal%20and%20copying%20the%20%3CEM%3EAPI%20server%20address%3C%2FEM%3E.%20Make%20sure%20to%20prefix%20with%20%3CEM%3Ehttps%3A%2F%2F%3C%2FEM%3E%20when%20pasting%20it%20in.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20174px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86376iF36D9FF2AC65095D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AKS_Service_Connection_02.png%22%20title%3D%22AKS_Service_Connection_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2060%20Azure%20DevOps%20Release%20Pipelines%20Step%209%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ETo%20acquire%20%3CEM%3Etoken%3C%2FEM%3E%20and%20%3CEM%3Ecertificate%3C%2FEM%3E%20you%20need%20to%20run%20the%20two%20%3CEM%3Ekubectl%3C%2FEM%3E%20commands%20listed%3A%3CBR%20%2F%3E%3CEM%3Ekubectl%20get%20-n%20kube-system%20serviceaccount%20tiller%20-o%20yaml%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Ekubectl%20get%20-n%20kube-system%20secret%20tiller-token-xyz%20-o%20yaml%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20second%20%3CEM%3Ekubectl%3C%2FEM%3E%20will%20give%20you%20an%20output%20with%20two%20Base64-encoded%20strings%20containing%20the%20token%20and%20certificate.%20Copy%20and%20paste%20these%20into%20the%20form%20and%20hit%20%3CEM%3EOK%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86377iCAC97715489988FE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22kubectl_04.png%22%20title%3D%22kubectl_04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2061%20Azure%20DevOps%20Release%20Pipelines%20Step%2010%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ENote%3A%20the%20UI%20includes%20the%20%3CEM%3Ekubectl%3C%2FEM%3E%20command%20without%20the%20namespace%20(kube-system)%20which%20means%20you%20will%20get%20an%20error%20that%20the%20service%20account%20cannot%20be%20found.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EYou%20can%20then%20define%20the%20second%20helm%20task.%20Reuse%20the%20%3CEM%3EKubernetes%20Service%20Connection%3C%2FEM%3E%20from%20the%20previous%20task.%20Make%20sure%20you%20choose%20%3CEM%3EFile%20path%3C%2FEM%3E%20as%20%3CEM%3EChart%20Type%3C%2FEM%3E%20and%20that%20the%20path%20contains%20%3CEM%3E%2F**%2F*.tgz%3C%2FEM%3E%20at%20the%20end.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20449px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86378i85E307E86BEC3736%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_08.png%22%20title%3D%22AzureDevOps_CD_08.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2062%20Azure%20DevOps%20Release%20Pipelines%20Step%2011%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EHit%20%3CEM%3ESave%3C%2FEM%3E%20followed%20by%20%3CEM%3ERelease%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20216px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86379i90E2250DB2BCC79E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_09.png%22%20title%3D%22AzureDevOps_CD_09.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2063%20Azure%20DevOps%20Release%20Pipelines%20Step%2012%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMake%20sure%20the%20%3CEM%3EVersion%3C%2FEM%3E%20aligns%20with%20your%20last%20build.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20638px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86381i0B9C013739E1DEC7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_10.png%22%20title%3D%22AzureDevOps_CD_10.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2064%20Azure%20DevOps%20Release%20Pipelines%20Step%2013%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20UI%20should%20indicate%20the%20progress%20of%20the%20deployment.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20664px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86382i4D5FD24AE27AE59D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_11.png%22%20title%3D%22AzureDevOps_CD_11.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2065%20Azure%20DevOps%20Release%20Pipelines%20Step%2014%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ELet%20it%20work%20its%20magic%20and%20watch%20things%20proceed%20to%20%3CEM%3ESucceeded%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20398px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86383iC21A07C204F8B3ED%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_12.png%22%20title%3D%22AzureDevOps_CD_12.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2066%20Azure%20DevOps%20Release%20Pipelines%20Step%2015%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EYou%20can%20click%20the%20task%20log%20and%20peek%20inside%20the%20helm%20upgrade%20log%20to%20see%20a%20%3CEM%3Ekubectl%3C%2FEM%3E%20output%20for%20verification.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20511px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86384iB0A94892D2C090FC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_13.png%22%20title%3D%22AzureDevOps_CD_13.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2067%20Azure%20DevOps%20Release%20Pipelines%20Step%2016%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EJumping%20back%20to%20the%20command%20line%20you%20can%20run%20%3CEM%3Ekubectl%20get%20all%3C%2FEM%3E%20to%20verify%20things%20outside%20the%20Azure%20DevOps%20UI.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86385i20B39F1DAD8537BB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_14.png%22%20title%3D%22AzureDevOps_CD_14.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2068%20Azure%20DevOps%20Release%20Pipelines%20Step%2017%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20output%20of%20a%20working%20CD%20pipeline.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20429px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86386iD026514D1D55ADAA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AzureDevOps_CD_15.png%22%20title%3D%22AzureDevOps_CD_15.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2069%20Azure%20DevOps%20Release%20Pipelines%20Step%2018%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe've%20come%20a%20long%20way%2C%20but%20there%20are%20a%20few%20loose%20threads.%20These%20will%20be%20tied%20up%20in%20the%20next%2C%20and%20concluding%2C%20part.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-359569%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20a%20multi-post%20walkthrough%20we%20take%20a%20tour%20through%20setting%20up%20building%20and%20deploying%20microservices%20on%20Azure%20through%20using%20Azure%20Kubernetes%20Service%20(AKS)%20and%20Azure%20DevOps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20part%20deals%20with%20building%20and%20deploying%20the%20code%20through%20setting%20up%20Continuous%20Integration%20and%20Continuous%20Deployment%20through%20Azure%20DevOps.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-369649%22%20slang%3D%22en-US%22%3ERe%3A%20Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%203%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369649%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20a%20lot%20for%20the%20clarification%20%3A)%3C%2FP%3E%3CP%3EAs%20soon%20as%20I%20finish%20reading%20Part%204%2C%20I'm%20going%20for%20understanding%20Helm%20and%20its%20charts.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-369647%22%20slang%3D%22en-US%22%3ERe%3A%20Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%203%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369647%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CFONT%3EIt's%20entirely%20possible%20that%20my%20explanations%20aren't%20clear%20enough%20here%20%3A)%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EHelm%20is%20basically%20an%20installer%20tool%2C%20and%20helm%20charts%20are%20the%20recipes%20for%20what%20you%20install.%20It%20is%20also%20often%20used%20for%20deploying%20third-party%20services%20(illustrated%20in%20part%204).%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3ESo%20when%20using%20Azure%20DevOps%20to%20deploy%20containers%20you%20can%20deploy%20either%20based%20on%20the%20Dockerfiles%2Fdocker-compose%2C%20or%20you%20can%20point%20it%20to%20helm-charts%20depending%20on%20your%20needs.%20For%20a%20non-public%20container%20with%20no%20relations%20to%20other%20containers%20it%20might%20not%20be%20necessary%20to%20use%20Helm%20other%20than%20standardizing.%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EThe%20CD%20pipeline%20used%20above%20is%20using%20the%20helm%20chart%20we%20defined%20earlier.%20The%20other%20deployment%20is%20basically%20a%20remnant%20from%20testing%20I%20did%20without%20helm%20that%20was%20not%20included%20in%20the%20guide.%20(I%20should%20have%20deleted%20it%20to%20not%20clutter%20the%20view.)%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-369638%22%20slang%3D%22en-US%22%3ERe%3A%20Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%203%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369638%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20I'm%20missing%20something%20here%2C%20the%20pieces%20are%20not%20fitting%20in%20together...%20I%20don't%20know%20exactly%20how%20Helm%20works%20or%20what%20Helm%20Charts%20are%2C%20and%20completely%20new%20to%20Kubernetes.%20But%20you%20just%20configured%20a%20CI%20pipeline%20for%20the%20API%20Playground%20service...%20and%20a%20CD%20pipeline%20as%20well.%20After%20the%20deployment%2C%20%3CSTRONG%3EFigure%2068%3C%2FSTRONG%3E%20shows%20an%20%3CEM%3Eazuredevops-api-playground%3C%2FEM%3E%20service%20with%209%20hours%20age%2C%20and%20an%20%3CEM%3Eakscd-helm-charts%3C%2FEM%3E%20service%20with%202%20minutes%20age.%20How%20come%3F%20Haven't%20we%20just%20deployed%20API%20Playground%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-642763%22%20slang%3D%22en-US%22%3ERe%3A%20Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%203%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-642763%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Andreas%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%20of%20all%20really%20nice%20article.%20Thank%20you%20for%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20some%20feedback%20on%20some%20of%20the%20issues%20that%20I%20have%20faced%20while%20setting%20up%20CI%20(haven't%20started%20CD%20yet).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBuild%20of%20Docker%20image%20fails%20on%20Dev%20ops%20with%20error%20file%20not%20found.%20I%20fixed%20that%20by%20changing%20the%20working%20directory.%20Following%20is%20the%20updated%20docker%20file%20that%20worked%20on%20dev%20ops.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F115892i4E8BF91E88C5FF36%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22dockerfile.PNG%22%20title%3D%22dockerfile.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20fixing%20this%20I%20got%20another%20error%20on%20the%20same%20step%20regarding%20input%20string.%20I%20fixed%20that%20by%20updated%20my%20csproj%20file%20and%20replacing%20the%20Guid%20and%20project%20name%20with%20an%20actual%20guid.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELastly%2C%20I%20got%20an%20error%20on%20helm%20package%20build%20'Chart%20not%20found'.%20I%20fixed%20it%20by%20browsing%20to%20the%20helm%20charts%20folder%20which%20was%20under%20yaml%20rather%20than%20at%20the%20root.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20it%20helps%20someone%20else.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

If you missed the previous parts they can be found here: 
Building Microservices with Azure Kubernetes Service and Azure DevOps - Part 1
Building Microservices with Azure Kubernetes Service and Azure DevOps - Part 2

 

By now you should have a cluster running, as well as the rest of the basics. But you need a way for the code to move from your desktop to the cluster.

 

Creating a Continuous Integration (CI) Pipeline in Azure DevOps

One of the major points of doing microservices and containers is avoiding the “it works on my machine. While containers are a vehicle for achieving this, we also need a vehicle for carrying the container from the developer workstation to other machines. In this guide that vehicle is Azure DevOps, the artist formerly known as Visual Studio Team Services (VSTS).

 

DevOps as a term encompasses more than just the technical pieces, but this guide will focus only on a few isolated components. The first part is Continuous Integration (CI) which handles building of the code, and the second part is Continuous Deployment (CD) which is about deploying the code built by CI. CD will be covered in the next section.

 

Let’s start by creating a new Dockerfile specifically for CI. Add a new file called Dockerfile.CI with the following contents:

 

FROM microsoft/dotnet:2.2-sdk AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM microsoft/dotnet:2.2-sdk
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "AKS-Web-App.dll"]

 

You will notice that Visual Studio arranges it as a child node under the existing Dockerfile.

 

We want to use Helm for packaging and deploying, and for this we need a helm chart. Create a default by executing the command below:

Helm_02.png

Figure 34 Creating a default helm chart

 

It is worth mentioning that there is an extension currently in preview for Visual Studio called Visual Studio Tools for Kubernetes that will automate this step for you. It is recommended to check this out, but for a deeper understanding this guide has chosen to not use this extension.

 

Why Helm is needed might not be clear at this point, but it adds a few extra configuration abilities. The following is a recap of the configuration files for a service:

  • Dockerfiles. These describe a single container with low-level details like base image, port openings, etc.
  • Docker-Compose. These describe a collection of containers that logically belong together. For example, having both a database container and an API container.
  • Helm charts. These typically describe additional metadata for the services, like the external url, the number of replicas, etc.

While it is not a requirement to use all three levels of configuration, it does make some things easier.

 

The default helm chart will actually not deploy the code you have in your VS solution, but instead an nginx container so a few adjustments will be needed. The helm charts have a templating system, but the important parts are in the values.yaml file. A simple file for this service would look like this:

 

# This is a YAML-formatted file.
# Declare variables to be passed into your templates.


replicaCount: 1

image:
repository: aksdotnetacr.azurecr.io/aksdotnetcoder
tag: latest
pullPolicy: IfNotPresent


nameOverride: ""
fullnameOverride: ""


service:
type: ClusterIP
port: 80


ingress:
enabled: false
annotations: {}
path: /
hosts:
   -
aksdotnetcoder
tls: []
# - secretName: chart-example-tls
#   hosts:
#     - chart-example.local

resources: {}
nodeSelector: {}
tolerations: []
affinity: {}

 

Check in your code and return to the Azure DevOps Portal.

AzureDevOps_CI_01.png

Figure 35 Azure DevOps Build Pipelines

 

If you go to Pipelines => Build you will have a rather blank space, so click New pipeline to get started.

AzureDevOps_CI_02.png

Figure 36 Azure DevOps Build Pipelines Step 1

 

Since the code is already checked into Azure Repos that will be the logical choice. In the next step choose Empty job as the template. There are default templates for Kubernetes, but there is a lack of visibility of what goes into them before firing it up, so this guide builds them manually by starting from scratch.

AzureDevOps_CI_03.png

Figure 37 Azure DevOps Build Pipelines Step 2

 

Give the pipeline a name and select Hosted Linux as the agent pool.

AzureDevOps_CI_04.png

Figure 38 Azure DevOps Build Pipelines Step 3

 

Start by adding two Docker tasks

AzureDevOps_CI_05.png

Figure 39 Azure DevOps Build Pipelines Step 4

 

The first Docker task is building the image. Select the Azure subscription and the Azure Container Registry created previously. Check the boxes as seen in the image, and make sure to add $(Build.BuildID) as additional image tags. If this task looks differently for you it might be that the Docker version has defaulted to 1.* whereas this sample uses 0.*.

AzureDevOps_CI_06.png

Figure 40 Azure DevOps Build Pipelines Step 5

 

The second Docker task is about pushing the image to ACR.

AzureDevOps_CI_07.png

Figure 41 Azure DevOps Build Pipelines Step 6

 

Next up is adding the necessary Helm tasks. Add one installer, and two package and deploy.

AzureDevOps_CI_08.png

Figure 42 Azure DevOps Build Pipelines Step 7

 

Version 2.12.3 is the latest at the time of writing, but it will automatically check each time it runs for new versions.

AzureDevOps_CI_09.png

Figure 43 Azure DevOps Build Pipelines Step 8

 

The first Helm task is a helm init.

AzureDevOps_CI_10.png

Figure 44 Azure DevOps Build Pipelines Step 9

 

The second Helm task is helm package.

AzureDevOps_CI_11.png

Figure 45 Azure DevOps Build Pipelines Step 10

 

To wrap up the build process it is necessary to add a Publish Build Artifacts task.

AzureDevOps_CI_12.png

Figure 46 Azure DevOps Build Pipelines Step 11

 

To simplify things during deploy add $(Build.BuildId) to the artifact name.

AzureDevOps_CI_13.png

Figure 47 Azure DevOps Build Pipelines Step 12

 

This should make the final CI Pipeline similar to the following screenshot:

AzureDevOps_CI_14.png

Figure 48 Azure DevOps Build Pipelines Step 13

 

To finish the CI process click Save & Queue to trigger a build.

AzureDevOps_CI_15.png

Figure 49 Azure DevOps Build Pipelines Step 14

 

Add some comments if you like, or just click Save & Queue.

AzureDevOps_CI_16.png

Figure 50 Azure DevOps Build Pipelines Step 15

 

If everything passes with flying colors it should be all green checkmarks.

AzureDevOps_CI_17.png

Figure 51 Azure DevOps Build Pipelines Step 16

 

If the results are satisfactory move on to building the CD pipeline by clicking Release in the header above the output.

 

Creating a Continuous Deployment (CD) Pipeline in Azure DevOps

A dev might be more than happy to see the CI pipeline finish in the green, but code that compiles isn’t worth much if you’re not able to deploy it, so the next part is about building a second pipeline to take care of that.

 

Go to Builds => Releases and create a new pipeline. This time also choosing the Empty job template.

AzureDevOps_CD_01.png

Figure 52 Azure DevOps Release Pipelines Step 1

 

Leave Stage 1 with the defaults.

AzureDevOps_CD_02.png

Figure 53 Azure DevOps Release Pipelines Step 2

 

Since you started based on a build pipeline you will already have an artifact step in addition to a stage.

AzureDevOps_CD_03.png

Figure 54 Azure DevOps Release Pipelines Step 3

 

Make sure that the artifacts look right and are linked to the build pipeline.

AzureDevOps_CD_04.png

Figure 55 Azure DevOps Release Pipelines Step 4

 

Go to Stage 1 and add one helm installer and two helm charts.

AzureDevOps_CD_05.png

Figure 56 Azure DevOps Release Pipelines Step 5

 

Install the latest helm version.   

AzureDevOps_CD_06.png

Figure 57 Azure DevOps Release Pipelines Step 6

 

The first helm task is a helm init. This has a twist though. Instead of using the Azure Resource Manager connection type, (used in the CI pipeline), it is required to use a Kubernetes Service Connection. (This is due to RBAC being enabled.) This screenshot shows the result, but initially you need to click +New to create the connection.

AzureDevOps_CD_07.png

Figure 58 Azure DevOps Release Pipelines Step 7

 

Choose Service account as authentication method.

AKS_Service_Connection_01.png

Figure 59 Azure DevOps Release Pipelines Step 8

 

The server URL can be found by browsing to the AKS deployment in the Azure Portal and copying the API server address. Make sure to prefix with https:// when pasting it in.

AKS_Service_Connection_02.png

Figure 60 Azure DevOps Release Pipelines Step 9

 

To acquire token and certificate you need to run the two kubectl commands listed:
kubectl get -n kube-system serviceaccount tiller -o yaml
kubectl get -n kube-system secret tiller-token-xyz -o yaml

 

The second kubectl will give you an output with two Base64-encoded strings containing the token and certificate. Copy and paste these into the form and hit OK.

kubectl_04.png

Figure 61 Azure DevOps Release Pipelines Step 10

 

Note: the UI includes the kubectl command without the namespace (kube-system) which means you will get an error that the service account cannot be found.

 

You can then define the second helm task. Reuse the Kubernetes Service Connection from the previous task. Make sure you choose File path as Chart Type and that the path contains /**/*.tgz at the end.

AzureDevOps_CD_08.png

Figure 62 Azure DevOps Release Pipelines Step 11

 

Hit Save followed by Release.

AzureDevOps_CD_09.png

Figure 63 Azure DevOps Release Pipelines Step 12

 

Make sure the Version aligns with your last build.

AzureDevOps_CD_10.png

Figure 64 Azure DevOps Release Pipelines Step 13

 

The UI should indicate the progress of the deployment.

AzureDevOps_CD_11.png

Figure 65 Azure DevOps Release Pipelines Step 14

 

Let it work its magic and watch things proceed to Succeeded.

AzureDevOps_CD_12.png

Figure 66 Azure DevOps Release Pipelines Step 15

 

You can click the task log and peek inside the helm upgrade log to see a kubectl output for verification.

AzureDevOps_CD_13.png

Figure 67 Azure DevOps Release Pipelines Step 16

 

Jumping back to the command line you can run kubectl get all to verify things outside the Azure DevOps UI.

AzureDevOps_CD_14.png

Figure 68 Azure DevOps Release Pipelines Step 17

 

The output of a working CD pipeline.

 AzureDevOps_CD_15.png

Figure 69 Azure DevOps Release Pipelines Step 18

 

We've come a long way, but there are a few loose threads. These will be tied up in the next, and concluding, part.

4 Comments
Occasional Visitor

I think I'm missing something here, the pieces are not fitting in together... I don't know exactly how Helm works or what Helm Charts are, and completely new to Kubernetes. But you just configured a CI pipeline for the API Playground service... and a CD pipeline as well. After the deployment, Figure 68 shows an azuredevops-api-playground service with 9 hours age, and an akscd-helm-charts service with 2 minutes age. How come? Haven't we just deployed API Playground? 

Senior Member
It's entirely possible that my explanations aren't clear enough here :)
 
Helm is basically an installer tool, and helm charts are the recipes for what you install. It is also often used for deploying third-party services (illustrated in part 4).
 
So when using Azure DevOps to deploy containers you can deploy either based on the Dockerfiles/docker-compose, or you can point it to helm-charts depending on your needs. For a non-public container with no relations to other containers it might not be necessary to use Helm other than standardizing.
 
The CD pipeline used above is using the helm chart we defined earlier. The other deployment is basically a remnant from testing I did without helm that was not included in the guide. (I should have deleted it to not clutter the view.)
Occasional Visitor

Thanks a lot for the clarification :)

As soon as I finish reading Part 4, I'm going for understanding Helm and its charts.

Occasional Visitor

Hi Andreas,

 

First of all really nice article. Thank you for it.

 

I have some feedback on some of the issues that I have faced while setting up CI (haven't started CD yet).

 

Build of Docker image fails on Dev ops with error file not found. I fixed that by changing the working directory. Following is the updated docker file that worked on dev ops.

 

dockerfile.PNG

 

After fixing this I got another error on the same step regarding input string. I fixed that by updated my csproj file and replacing the Guid and project name with an actual guid.

 

Lastly, I got an error on helm package build 'Chart not found'. I fixed it by browsing to the helm charts folder which was under yaml rather than at the root. 

 

I hope it helps someone else.