Sunday, 15 March 2020

Azure DevOps Pipeline

Azure DevOps Pipeline

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.
There are three key distinct advantages of using Azure DevOps pipelines.
Azure DevOps Pipeline
Version control system: Azure Pipelines integrates with GitHub, GitHub Enterprise, Azure Repos Git & TFVC, Bitbucket Cloud, and Subversion.
Language and application types: We can use Azure Pipeline with most application types and languages, such as Java, JavaScript, Node.js, Python, .Net, C++, Go, PHP, and Xcode.
Deployment target: We can use Azure Pipelines to deploy our code to multiple targets. Targets include - container registries, virtual machines, Azure services, or any on-premises or cloud target.

Azure DevOps Pipeline concepts

  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.

Publish ARM deployment project into DevOps Repos and deploy using pipeline

Azure DevOps Pipeline
Step 1: Go into the Azure DevOps project and click on pipelines. After that, click on the New pipeline button.
Azure DevOps Pipeline
Step 2: Now, Click on the "use the classic editor" link down below.
Azure DevOps Pipeline
Step 3: Select the project and repository where you want to create the pipeline then click on Continue.
Azure DevOps Pipeline
Step 4: Click on the Empty job link to create a job.
Azure DevOps Pipeline
Step 5: Now, you need to add a task for building the activity. Click on the add button on the Agent job 1, then type-in resource group. Finally, click on the Azure Resource group deployment add button.
Azure DevOps Pipeline
Step 6: Now, you need to select in which Azure subscription you want to deploy the infrastructure, into which resource group you want to deploy, and what you want to deploy in the form of JSON.
Azure DevOps Pipeline
Step 7: Select the template from the repository.
Azure DevOps Pipeline
Step 8: After that, select the parameters file.
Azure DevOps Pipeline
Step 9: Finally, click on Save & Queue. The deployment will take some time.
Azure DevOps Pipeline
Step 10: Now, you can see the build has been completed successfully.
Azure DevOps Pipeline

No comments:

Post a Comment