<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: abrarmoiz</title>
    <description>The latest articles on DEV Community by abrarmoiz (@abrarmoiz).</description>
    <link>https://dev.to/abrarmoiz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F391045%2Fe574a118-e0fc-437e-9d42-d6b51f2da48a.png</url>
      <title>DEV Community: abrarmoiz</title>
      <link>https://dev.to/abrarmoiz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abrarmoiz"/>
    <language>en</language>
    <item>
      <title>CICD pipelines: Application Developers perspective</title>
      <dc:creator>abrarmoiz</dc:creator>
      <pubDate>Mon, 26 Feb 2024 08:36:55 +0000</pubDate>
      <link>https://dev.to/abrarmoiz/cicd-pipelines-application-developers-perspective-5dpa</link>
      <guid>https://dev.to/abrarmoiz/cicd-pipelines-application-developers-perspective-5dpa</guid>
      <description>&lt;p&gt;This blog presents an alternate view of CICD pipelines with an example of AKS build deployment using GitHub actions.&lt;/p&gt;

&lt;p&gt;A simplified view of CI pipeline is to allow developers to relate to and make the CICD pipelines more readable and update or fix any issues quickly in the CICD pipeline. The CI pipeline can be considered as an automated list of steps any developer would follow to get his code built and pushed into a code artifact repo.&lt;/p&gt;

&lt;p&gt;Consider a situation where in there is no devops team around or you are just moved to devops team from a development background.  &lt;/p&gt;

&lt;p&gt;A quick view of the steps a developer would take and their matching automation step Github actions. (A similar action can be found on any other CI/CD tool like Azure Devops) &lt;/p&gt;




&lt;h3&gt;
  
  
  1. Code Build Phase
&lt;/h3&gt;

&lt;p&gt;Our developer in this first step wants to build the code and save the created code output in a safe location.  Previously depending the language the output could be a war / jar / zip file or dll file and it would be saved in versioned format.&lt;br&gt;&lt;br&gt;
  Since in this case we deal with a containerized output i.e. a container image. The developer needs to save the image in an image repo like docker hub, ACR or ECR &lt;/p&gt;
&lt;h6&gt;
  
  
  First the developer needs machine to run the build on it can be a windows or linux machine a VM
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
runs-on: ubuntu-latest

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  Next the developer would want to checkout the code
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Code checkout
  uses: actions/checkout@v3  
  with:
   ref: ${{github.head_ref}}
   fetch-depth: 0          

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;&lt;em&gt;github.head_ref&lt;/em&gt;&lt;/strong&gt; is a reference to the github repo and branch links saved as a variable in github actions &lt;/p&gt;
&lt;h6&gt;
  
  
  Developer needs to now authenticate / configure the container registry in our case Azure Container Registry where the code in form of container images would reside
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
      - name: Login to Azure Container Registry
        uses: docker/login-action@v2
        with:
          registry: ${{ secrets.ACR_URL }}
          username: ${{ secrets.ACR_USERNAME }}
          password: ${{ secrets.ACR_PASSWORD }}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Since we are dealing with credentials of ACR, it would be better saved as a secret. &lt;/p&gt;

&lt;p&gt;Refer to this &lt;a href="https://docs.github.com/actions/security-guides/encrypted-secrets"&gt;link&lt;/a&gt; for using secrets in github. &lt;/p&gt;
&lt;h6&gt;
  
  
  Developer then would run a build i.e. a docker build and push the created docker image into the aforementioned container registry
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Build docker image and push to registry
        uses: docker/build-push-action@v4
        with:
          context: ${{ inputs.PROJECT_PATH }}
          file: ${{ inputs.DOCKERFILE_PATH }}
          push: true
          build-args: |
            build_id = ${{ steps.vars.outputs.sha_short }}
          tags: ${{ secrets.ACR_URL }}/${{ steps.vars.outputs.project_name }}:${{ steps.vars.outputs.sha_short }}
          cache-from: type=registry, ref=${{ secrets.ACR_URL }}/${{ steps.vars.outputs.project_name }}:latest
          cache-to: type=inline


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this action &lt;strong&gt;&lt;em&gt;steps&lt;/em&gt;&lt;/strong&gt; is a variable internal to github action used to refer to predefined variables.  &lt;/p&gt;

&lt;p&gt;With the above list of steps you have a got a basic CI pipeline running. Always remember&lt;br&gt;
 CI = checking out code, building / compiling code using the dependencies &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zzqxv7lcy6u9byh6qyz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zzqxv7lcy6u9byh6qyz.png" alt="Basic container build" width="640" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have got an artifact at this stage. A responsible developer however would want to run the test cases to ensure a new PR or code commit doesn’t break the existing functionality.  &lt;/p&gt;


&lt;h3&gt;
  
  
  2. Test Phase
&lt;/h3&gt;
&lt;h6&gt;
  
  
  The developer again would need a machine to run the tests it can be a windows or linux machine a VM
&lt;/h6&gt;

&lt;p&gt;&lt;code&gt;runs-on: ubuntu-latest&lt;/code&gt;&lt;/p&gt;
&lt;h6&gt;
  
  
  Developer would again want to checkout the code
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
       - name: Code checkout
         uses: actions/checkout@v3  
         with:
           ref: ${{github.head_ref}}
           fetch-depth: 0          

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  Developer would need to now set up the local environment to run tests and default test suite to get executed
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Execute unit tests
  if: inputs.TESTCASE_INPUT != ''
  defaults:
   run:
    working-directory: ${{ inputs.TESTCASES_FOLDER }}/ ${{inputs.TESTCASE_INPUT}}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this step &lt;em&gt;**inputs... *&lt;/em&gt;* is referred to the variables passed to the github actions&lt;/p&gt;
&lt;h6&gt;
  
  
  Setup coding language version
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Install dependencies
  run: |
    python -m pip install --upgrade pip
    pip install -r requirements.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  Now execute the tests
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Install dependencies
  run: |
   pip install pytest pytest-cov
   pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As this stage we realize why the team lead and the architects have been after us to increase the code coverage. Remember a good code coverage always allows you to catch the errors early. We have heard that multiple times earlier. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bjkacdrg8zsp95wycua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bjkacdrg8zsp95wycua.png" alt="Python test setup" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Code Deploy Phase
&lt;/h3&gt;

&lt;p&gt;Finally, the developer needs to run this application on cloud or on premise. In our case its going to be AKS cluster on azure cloud. The developer pulls out the image pushed into the registry and tries to run it into the compute layer. The compute layer could be Azure web service or a VM here we consider an AKS cluster&lt;/p&gt;

&lt;p&gt;Assumption:  AKS, DB the application relies on is already setup we deal with only delivery of application code  &lt;/p&gt;
&lt;h6&gt;
  
  
  Developer would again need a VM or machine to deploy the code from
&lt;/h6&gt;

&lt;p&gt;&lt;code&gt;runs-on: ubuntu-latest&lt;/code&gt;&lt;/p&gt;
&lt;h6&gt;
  
  
  Login to a cloud environment in our case an Azure environment
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Azure Login
  uses: azure/login@v1
  with:
    creds: ${{ secrets.AZURE_CREDENTIALS }}
    fetch-depth: 0          

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  Developer would need to identify the proper AKS where the application code in form of docker image would reside this is done by setting the AKS context by identifying resource group, subscription group and AKS cluster name
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Set AKS Context
  uses: azure/aks-set-context@v3
  with:
    resource-group:
    ${{ secrets.RESOURCE_GROUP }}
    cluster-name: ${{ secrets.CLUSTER_NAME }}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  Authenticate into ACR container registry
&lt;/h6&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Login to Azure Container Registry
  uses: docker/login-action@v2
  with:
   registry: ${{ secrets.ACR_URL }}
   username: ${{ secrets.ACR_USERNAME }}
   password: ${{ secrets.ACR_PASSWORD }}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  Finally refresh the AKS deployment with the latest version of container image.
&lt;/h6&gt;

&lt;p&gt;This will involve installation of kubectl tool, configuring kubeconfig from the secrets and running the k&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- name: Set up Kubectl
  uses: azure/k8s-set-context@v1
  with:
    kubeconfig: ${{ secrets.KUBECONFIG }}
- name: Deploy
  run: |
     kubectl apply -f kubernetes/deployment.yaml
     kubectl apply -f kubernetes/service.yaml

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above step could also be accomplished using helm charts. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg3a1g0trxtdx0rkhrdcn.png" alt="Deployment in AKS" width="800" height="167"&gt;
&lt;/h2&gt;

&lt;p&gt;The entire CI/CD pipeline therefore can be viewed at a basic level by breaking it up into smaller jobs which are an automation of a developer’s day to day tasks of code build, running unit tests and deployment to a cloud server instead of running on his laptop.  &lt;/p&gt;

&lt;p&gt;Each of the main sections could be considered as a github action &lt;strong&gt;&lt;em&gt;job&lt;/em&gt;&lt;/strong&gt; and every developer activity we went through is a &lt;strong&gt;&lt;em&gt;step&lt;/em&gt;&lt;/strong&gt;. Different implementations of CI/CD may call each step with a different name i.e. a job, step, trigger can be referred and have syntactically different ways of representation in different tools. Refer to this link for a comparison of different CICD tools &lt;a href="https://github.com/cdfoundation/sig-interoperability/blob/main/docs/tools-terminology.md#terminology-used-by-cicd-tools-and-technologies"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, our pipeline is not production ready!  The major difference between these steps and a CICD pipeline fit to be used in a production environment would be:&lt;/p&gt;

&lt;h3&gt;
  
  
  a. Optimizing steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Remove duplicate steps between jobs for e.g. code checkout in build and test jobs to be reduced to only one &lt;/li&gt;
&lt;li&gt;Add dependencies between stages to ensure one stage is completed before the next one starts. e.g. deploy cannot start until build is completed&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0zbb7252emar4qen5p1j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0zbb7252emar4qen5p1j.png" alt="Image description" width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  b.  Adding security scanners to CICD:
&lt;/h3&gt;

&lt;p&gt;Various measures are implemented to ensure the final output from the CI Pipeline is free from vulnerabilities. This is done by scanning code / code artifact by adding a few additional steps in the CI pipeline. This is a quality control applied on the CI pipeline. For this can use the standard github (or any custom CICD) actions to the pipeline which addresses the following – &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Static Application Security Testing (SAST) e.g. SonarQube , Sonar cloud&lt;/li&gt;
&lt;li&gt; Dynamic Application Security Testing (DAST) e.g. Snyk, ZAP&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  c.  Event based execution:
&lt;/h3&gt;

&lt;p&gt;The execution of the entire pipeline needs to be all glued to an event it could be PR approval or Commit to a branch or Creation etc.,&lt;/p&gt;

&lt;h3&gt;
  
  
  d.  Continous delivery first and then continous deployment:
&lt;/h3&gt;

&lt;p&gt;In the real world the deploy stage evolves first into a human monitored &lt;strong&gt;&lt;em&gt;continous delivery&lt;/em&gt;&lt;/strong&gt; and if the processes mature enough then it moves onto &lt;strong&gt;&lt;em&gt;continous deployment&lt;/em&gt;&lt;/strong&gt; something which devops teams would need to ponder over. &lt;/p&gt;

&lt;h5&gt;
  
  
  An overall view of our jobs in form of a CICD pipeline after implementing all the CICD best practices
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc2eeh9hapgi3of8sb5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc2eeh9hapgi3of8sb5p.png" alt="Overall view" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>aks</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Hybrid CI CD: Cloud based CI and On premise CD Solution</title>
      <dc:creator>abrarmoiz</dc:creator>
      <pubDate>Mon, 08 Mar 2021 14:01:15 +0000</pubDate>
      <link>https://dev.to/abrarmoiz/hybrid-ci-cd-cloud-based-ci-and-on-premise-cd-solution-2dn3</link>
      <guid>https://dev.to/abrarmoiz/hybrid-ci-cd-cloud-based-ci-and-on-premise-cd-solution-2dn3</guid>
      <description>&lt;p&gt;Use of (cloud-based) Azure Devops CI tool with (on premise) Octopus deploy CD tool. This blog explains steps to move towards a cloud-based solution from an on premise one. &lt;/p&gt;

&lt;p&gt;Follow steps below to implement this solution: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use of on-premise agents: The concern with this implementation was the deployment would happen on premise servers using Octopus. To implement this solution we used the “On-premise” Agents. The type of agents,  communication and authentications steps are all discussed in &lt;a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&amp;amp;tabs=browser"&gt;https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&amp;amp;tabs=browser&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XD9QPRV4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwlmd03ejo45tq6rk33c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XD9QPRV4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwlmd03ejo45tq6rk33c.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Setting up default agent: Ensure the user has sufficient permissions and identify a suitable littler on-premises agent. Then follow the steps in &lt;a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops"&gt;https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops&lt;/a&gt; to set up the agent. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0F-DNewZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2m6zda0qjy6ijdx705u1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0F-DNewZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2m6zda0qjy6ijdx705u1.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Azure Devops Plugins: Following plugins are installed :&lt;br&gt;
a. Red gate plugin to facilitate Integration with Redgate SQL Change Automation (&lt;a href="https://marketplace.visualstudio.com/items?itemName=redgatesoftware.redgateDlmAutomationBuild"&gt;https://marketplace.visualstudio.com/items?itemName=redgatesoftware.redgateDlmAutomationBuild&lt;/a&gt;) &lt;/p&gt;

&lt;p&gt;b. Octopus plugins for deployment (&lt;a href="https://marketplace.visualstudio.com/items?itemName=octopusdeploy.octopus-deploy-build-release-tasks"&gt;https://marketplace.visualstudio.com/items?itemName=octopusdeploy.octopus-deploy-build-release-tasks&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TnSVl801--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3p3h2dga3eccolkn9j7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TnSVl801--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3p3h2dga3eccolkn9j7.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Setting up of additional Octopus projects: Create additional projects to receive output artifacts from Azure Devops pipeline.&lt;/p&gt;

&lt;p&gt;These projects would receive build artifacts from Azure Devops.  The additional projects were setup to: &lt;br&gt;
a. Avoid any impact to progress on tickets dependent on Octopus&lt;br&gt;
b. Existing projects in octopus have a Team city specific configuration, this was modified to generic one in &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pzt49ehY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifhk2ke5jrrzd8hg0gq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pzt49ehY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifhk2ke5jrrzd8hg0gq7.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ensure the code is in a cloud based repository: Either Azure repo / github / gitlab / bitbucket etc..,&lt;/p&gt;

&lt;p&gt;Setting up pipelines in Azure Devops:  Follow steps to setup azure build pipeline (for e.g. follow &lt;a href="https://azuredevopslabs.com/labs/azuredevops/yaml/"&gt;https://azuredevopslabs.com/labs/azuredevops/yaml/&lt;/a&gt; to set up a pipeline) however ensure the agent pool in Azure Devops is set to default (as we have defined the agent to be default in step 2) and have the following major tasks in each pipeline:&lt;/p&gt;

&lt;p&gt;a. NuGetCommand@2 &lt;br&gt;
  b. VSBuild@1&lt;br&gt;
  c. OctopusPack@4&lt;br&gt;
  d. OctopusCreateRelease@4&lt;br&gt;
  e. OctopusDeployRelease@4&lt;/p&gt;

&lt;p&gt;For Steps c,d and e follow &lt;a href="https://octopus.com/docs/packaging-applications/build-servers/tfs-azure-devops/using-octopus-extension"&gt;https://octopus.com/docs/packaging-applications/build-servers/tfs-azure-devops/using-octopus-extension&lt;/a&gt; which results in packaging/ creating a release and deploying a release in Octopus from Azure Devops&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Note : Since we are using Azure Devops as a CI tool we will only be setting up the build pipelines and not the release pipelines &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
