Blog Post

Azure Infrastructure Blog
5 MIN READ

How to Create a Harness Pipeline and integrate with Azure

gjayadev's avatar
gjayadev
Icon for Microsoft rankMicrosoft
Mar 10, 2026

Building reliable, automated CI/CD pipelines is crucial for modern cloud applications. Harness — with its powerful pipeline orchestration — integrates seamlessly with Microsoft Azure, enabling teams to deploy applications faster, with stronger governance, security, and visibility.

In this blog, you’ll learn how to create a Harness pipeline and integrate it with Azure services. We will walk through:

  • Introduction to Harness and its role in CI/CD
  • High-level explanation of key Harness components, including:
    • Harness Delegate
    • Azure Connector
    • Secrets Manager
    • Organizational Hierarchy
  • Overview of how Harness integrates with Azure
  • Step-by-step creation and execution of a CI pipeline in Harness, including adding stages, configuring infrastructure, defining execution steps, and running the pipeline.

Whether you're new to Harness or looking to streamline your cloud deployments, this guide will help you set up a clean, scalable, production-ready delivery workflow.

What is Harness? 

Harness is a modern CI/CD platform that automates software delivery using: 

  • Continuous Integration (CI) 
  • Continuous Delivery (CD) 
  • Feature Flags 
  • Cloud Cost Management 
  • Security Testing 
  • Chaos Engineering 

What makes Harness unique is its Delegate-based execution model, which performs deployments securely from your own environment. 

 

Key Harness Components

To successfully integrate Harness with Azure for modern CI/CD workflows, it’s important to understand the core components that drive secure, scalable automation. This section highlights the Harness Delegate, Azure Connector, Secrets Manager, and Organizational Hierarchy—each playing a vital role in connecting, managing, and deploying your applications in the cloud.

 

1. Harness Delegate

The Harness Delegate is a lightweight agent you install in your own infrastructure (such as an Azure VM, Kubernetes cluster, or VNet). It acts as a secure bridge between Harness’s SaaS control plane and your internal resources. The Delegate executes pipeline tasks, connects to Azure services, and manages deployments—all while keeping your credentials and secrets within your environment. Delegates communicate outbound over HTTPS, making them firewall-friendly and easy to manage.

 

Source: https://developer.harness.io/docs/platform/get-started/key-concepts

2. Azure Connector

Connector in Harness is a configuration that securely stores all the information needed to connect to external tools—like Azure. The Azure Connector holds credentials, endpoints, and metadata, allowing the Delegate to authenticate and interact with Azure resources (VMs, storage, AKS, etc.) during pipeline execution. Connectors abstract away connection details, so you can reference them by name in your pipelines and keep your secrets safe.

 

3. Secrets Manager

Secrets Management in Harness ensures that sensitive values (like Azure service principal credentials, API keys, or passwords) are encrypted and securely stored. Harness can integrate with external secrets managers (such as Azure Key Vault or HashiCorp Vault) or use its own built-in secrets store. Delegates retrieve secrets only at runtime, ensuring credentials are never exposed in logs or pipeline code. This is critical for secure CI/CD in cloud environments.

 

4. Organizational Hierarchy

Harness organizes resources using a clear hierarchy:

  • Account: The top-level container for your company.
  • Organization: Represents a business unit or division, grouping related projects.
  • Project: Where actual pipelines, connectors, secrets, and delegates are defined and used.

Resources like connectors, secrets, delegates, and templates can be defined at the account, org, or project level, and shared as needed. This structure makes it easy to manage access, governance, and reusability across teams and applications.

 

How Harness Connects to Azure

 

To integrate with Azure, Harness uses: 

  1. Azure Connector

Used to authenticate Harness with your Azure Subscription using: 

  • Client ID 
  • Tenant ID 
  • Client Secret 
  • Subscription ID 
  1. Kubernetes Connector

Used when deploying to Azure Kubernetes Service (AKS). 

  1. Secrets Manager

Stores Azure SP credentials securely. 

  1. Harness Delegate

A lightweight agent installed inside your Azure environment (VM/AKS). 
It executes: 

  • Deployment tasks 
  • Authentication 
  • Manifest retrieval 
  • Rollbacks 
  • Script execution 

Step-by-step pipeline creation in Harness

This guide explains how to set up a CI pipeline in Harness with Azure from scratch—covering each major step, what it means, and why it is needed. 

Step 1: Create a New Pipeline 

This creates an empty pipeline where you can add stages that define what work the pipeline performs. 

  • Go to your Harness Project
  • Click Pipelines  New Pipeline 
  • Enter a name for your pipeline 
  • Click Start 

 

Step 2: Add a CI Stage 

A CI (Continuous Integration) stage is used for running code, scripts, builds, tests, or automation tasks. This is the core of your pipeline. 

  • Click Add Stage 

 

 

  • Choose CI
  • Select Infrastructure Stage (Build for trial version)  

 

  •  Give the stage a name (example: BuildScript Execution, etc.) 
  • Click Set Up Stage 

 

 

Step 3: Select the Build Infrastructure 

The pipeline must run somewhere. This step tells Harness which environment (cloud/K8s/local) will execute your tasks. 

Inside the stage, open the infrastructure tab. 

 

Choose where the CI tasks should run: 

Options you will see: 

  • Cloud 
  • Kubernetes 
  • Local 
  • VMs 

Most common choice: 

 Kubernetes (runs your steps using your Harness delegate inside a Kubernetes cluster) 

After selecting the infrastructure: 

  • Choose the platform  

 

 

  • Choose your Kubernetes Connector 
  • Select the Namespace 

 

  • Save 

 

 

Step 4: Add Execution Steps in the Stage 

This is the actual work your pipeline will perform. Every task is added as a step. 

Go to the Execution tab  click Add Step 

 

You can choose: 

  • Run Step  execute shell or PowerShell commands 
  • Build & Push  build container images 
  • Plugin Step  use pre-built plugins 
  • Test Step  run automated tests 

 

For a basic CI pipeline, choose: 

 Run Step 

Then configure: 

  • Name (example: Run ScriptPrint Message, etc.) 
  • Shell Type  Bash / PowerShell 
  • Container Image (example: alpine, ubuntu, mcr.microsoft.com/azure-powershell, etc.) 
  • Command 
    Example: echo "Running basic CI pipeline in Harness" 

 

A Terraform step would like below 

Step 5: Configure Environment Variables 

Allows scripts to use dynamic values without hardcoding them. 

If your script needs inputs, API keys, or configs: 

  • Open your Run Step 
  • Scroll to Environment Variables 
  • Add key–value pairs or map them from Harness Secrets 

 

 

Step 6: Add Multiple Steps  

Enables you to design a full automation flow inside the pipeline. 

You can add more steps such as: 

  • Running unit tests 
  • Running linting 
  • Running more shell scripts 
  • Uploading artifacts 
  • Sending notifications 

 

 

 

 

Step 7: Save and Run the Pipeline 

Execute your pipeline using the Harness Delegate and infrastructure you configured. 

  • Click Save 
  • Click Run 

Harness will now: 

  • Spin up a pod or VM (based on your infrastructure selection) 
  • Pull the container image you selected 
  • Execute your CI steps one by one 
  • Show real-time logs 
  • Mark the run as Success or Failed 
Updated Mar 10, 2026
Version 1.0
No CommentsBe the first to comment