Saturday, March 26, 2022

Azure DevOps - Azure Pipelines + Lab

 Azure Pipeline is a cloud service that we can use to build and test our code project automatically. The Azure pipeline has a lot of capabilities such as continuous integration and continuous delivery to regularly and consistently test and builds our code and ship to any target.

  1. Pipeline: It is a workflow that defines how our test, build, and deployment steps are run.
  2. Stage: It is a logical boundary in the pipeline. It can be used to mark the separation of concerns. Each stage contains one or more jobs.
  3. Job: A stage can contain one or more jobs. Each job runs on an agent. It represents an execution boundary of a set of steps.
  4. Step: It is the smallest building block of a pipeline. It can either be a script or a task. A task is simply an already created script offered as a convenience to you.
  5. Agent and Agent pools: An agent is an installable software that runs one job at a time. Instead of managing each agent individually, you organize agents into agent pools.
  6. Artifact: It is a collection of files or packages published by a run. The Artifact is made available to subsequent tasks, such as distribution or deployment.
  7. Trigger: It is something that is set up to tell the pipeline when to run. We can configure a pipeline to run upon a push to the repository, at scheduled times, etc.
  8. Environment: It is a collection of resources, where you deploy your application. It contains one or more virtual machines, containers, web apps, etc.
  9. Checks: Checks define a set of validations required before a deployment can be performed.
  10. Runs: It represents a single execution of a pipeline and collects the logs associated with running the steps and the results of running tests

Create New Pipeline

Step 1: Select Pipeline and Click on Create pipeline button.
Step 2: Select Azure Repos Git and select the repo which has Core application
Step 3: Select Asp.Net Core Run time.
Step 3: Modify the script as below

- master
  vmImage: 'windows-latest'
- bash: echo "Hello Azure DevOps Pipeline"

Step 4: Click on Save and Run Pipeline.
Step 5: azure-pipeline.yml file will be created and versioned in master branch.

Edit Existing Pipeline

Step 1: Select the pipeline and click on Edit
Step 2: Update the code as given below and click on save button

- master
  vmImage: 'windows-latest'
- job: FirstJob
  timeoutInMinutes: 10
  - bash: echo "First Job"  
- job: SecJob
  - bash: echo "Sec Job"  
Step 3: Once you save the pipeline will be automatically get executed.


Post a Comment