> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/artifact-registry/3.0/platform-integrations/harness-cd.md).

# Harness CD

Deploy artifacts stored in Harness Artifacts directly from Harness CD pipelines without configuring external connectors or credentials.

Harness Continuous Delivery (CD) integrates natively with Harness Artifacts, so you can deploy stored artifacts without creating a connector or entering credentials. When you select Harness Artifacts as the artifact source in a CD service, the pipeline authenticates automatically and pulls the specified artifact version during execution.

This page covers configuring a CD service to use artifacts from Harness Artifacts, the supported artifact formats, and referencing Harness Artifacts images in containerized step group Run steps.

***

## How it works

The integration follows a streamlined workflow:

1. **Configure the artifact source**. In your CD service definition, select Harness Artifacts as the artifact source type. Specify the registry, repository format, and image or package details.
2. **No connector required**. Unlike external registries, Harness Artifacts does not need a Docker connector or stored credentials. The pipeline authenticates as the identity that runs it.
3. **Automatic artifact resolution**. During pipeline execution, Harness authenticates with the registry, pulls the specified artifact version, and deploys it to the target environment.

***

## Before you begin

* **Harness account with Artifacts and CD enabled**. You need artifacts already stored in a Harness Artifacts registry. To create a registry, go to [Create a registry](https://developer.harness.io/artifact-registry/3.0/registries/create-a-registry.md).
* **Harness Artifacts license**. Your account needs a valid HAR license.
* **CD pipeline with a deploy stage**. To learn about CD fundamentals, go to the [Harness CD documentation](https://developer.harness.io/continuous-delivery).
* **Kubernetes Cluster connector** (only for the containerized step group flow). To add a Kubernetes Cluster connector, go to [Add a Kubernetes Cluster connector](https://developer.harness.io/harness-platform/use-harness-platform/connectors/cloud-providers/add-a-kubernetes-cluster-connector).

***

## Supported artifact formats

The following artifact formats are supported as CD artifact sources from Harness Artifacts:

* **Docker**: Container images for Kubernetes, AWS Lambda, Tanzu, serverless, and custom deployments.
* **Generic**: Binary files and archives for SSH, WinRM, and custom deployments.
* **npm**: Node.js packages for SSH, WinRM, and custom deployments.
* **NuGet**: .NET packages for SSH, WinRM, and custom deployments.
* **Maven**: Java artifacts for SSH, WinRM, and custom deployments.
* **Raw**: Raw files for WinRM deployments only.

{% hint style="info" %}
The **Raw** repository format is supported as an artifact source only for **WinRM** deployment types.
{% endhint %}

Harness Artifacts works with all major CD deployment swimlanes. To view the complete list of supported swimlanes and artifact types, go to [CD integrations](https://developer.harness.io/continuous-delivery/new-to-continuous-delivery/cd-integrations).

***

## Configure a CD service with Harness Artifacts

You can configure the artifact source through the Harness UI or YAML.

{% tabs %}
{% tab title="Harness UI" %}

1. **Create or open a service**. In your project, go to **Deployments** > **Services**. Select **New Service** or open an existing service.
2. **Set the deployment type**. In **Service Definition**, select the deployment type (for example, **Kubernetes**).
3. **Add an artifact source**. In the **Artifacts** section, select **Add Artifact Source**. In **Specify Artifact Repository Type**, select **Artifact Registry** and select **Continue**.
4. **Configure artifact details**. Fill in the following fields:
   * **Artifact Source Identifier**: A name that identifies this artifact source.
   * **Repository Format**: The artifact format (for example, `docker`).
   * **Registry**: The Harness Artifacts registry where your images or packages are stored.
   * **Image Path** (for Docker) or the equivalent field for your format: The artifact name.
   * **Tag**: The version tag, or use a runtime input (`<+input>`) to select at deployment time.
   * **Digest** (optional): A specific image digest for immutable deployments.
5. **Save the configuration**. Select **Submit**. The artifact source is added to the service definition.

{% hint style="info" %}
If you use a runtime input for **Tag**, Harness pulls the list of available tags from the registry at deployment time and prompts you to select one.
{% endhint %}

{% hint style="info" %}
If an image with the specified tag and digest combination does not exist in the registry, the pipeline fails at execution time.
{% endhint %}
{% endtab %}

{% tab title="YAML" %}
The following YAML defines a Kubernetes service that uses a Docker image from Harness Artifacts:

```yaml
service:
  name: k8s_service
  identifier: k8s_service
  orgIdentifier: default
  projectIdentifier: <PROJECT_ID>
  serviceDefinition:
    spec:
      artifacts:
        primary:
          sources:
            - identifier: demo_artifact
              type: Har
              spec:
                registryRef: dev
                type: docker
                spec:
                  imagePath: my-app
                  tag: <+input>
                  digest: ""
          primaryArtifactRef: demo_artifact
    type: Kubernetes
```

| Field          | Description                                                                                   |
| -------------- | --------------------------------------------------------------------------------------------- |
| `type: Har`    | Identifies Harness Artifacts as the artifact source type.                                     |
| `registryRef`  | The identifier of the target registry in Harness Artifacts.                                   |
| `type: docker` | The repository format. Supported values: `docker`, `generic`, `npm`, `nuget`, `maven`, `raw`. |
| `imagePath`    | The name of the image or package in the registry.                                             |
| `tag`          | The version tag. Use `<+input>` for runtime selection.                                        |
| `digest`       | (Optional) An image digest for immutable deployments.                                         |
| {% endtab %}   |                                                                                               |
| {% endtabs %}  |                                                                                               |

***

## Referencing Harness Artifacts images in containerized step group Run steps

You can reference container images from Harness Artifacts in CD **Run** steps that execute inside a **containerized step group**. This is useful when your deployment pipeline needs a custom tool image for scripting or validation tasks.

1. **Add a step group**. In your CD pipeline stage, go to **Execution** and add a **Step Group**.
2. **Enable container-based execution**. In the step group configuration, enable **Container based execution**. In **Kubernetes Cluster**, select a Harness Kubernetes Cluster connector for the cluster where the step containers run.
3. **Add a Run step**. Inside the step group, select **Add Step** and add a **Run** step.
4. **Select Harness Artifacts**. In the Run step, set **Registry Type** to **Artifact Registry**. In **Container Registry**, select the registry that hosts the image. In **Image**, enter the image reference (for example, `my-tools:2.1.0`).
5. **Configure and save**. Add your run command and select **Apply Changes**.

{% hint style="info" %}
Select **Third-Party Artifact Registry** instead when you want to pull the image from an external Docker registry through a Harness Docker connector.
{% endhint %}

***

## Permissions

To use Harness Artifacts as an artifact source in CD pipelines:

* Your account needs a valid **Harness Artifacts license**.
* The pipeline identity needs appropriate **RBAC permissions** to access the target registry.
* No connector or username is required. The pipeline authenticates as the identity that runs it.

To configure RBAC, go to [RBAC and permissions](https://developer.harness.io/artifact-registry/3.0/reference/rbac-and-permissions.md).

***

## Troubleshooting

<details>

<summary>The artifact source does not list any registries</summary>

Verify that your account has a valid Harness Artifacts license and that registries exist in the current project scope. If registries are in a different organization or project, verify that the pipeline identity has cross-project access.

</details>

<details>

<summary>The pipeline fails with an artifact-not-found error</summary>

Verify that the tag or digest specified in the artifact source exists in the registry. If you use a runtime input for the tag, confirm that the selected tag is still available. Open the registry in the Harness UI and check that the artifact is listed.

</details>

<details>

<summary>A Run step in a containerized step group cannot pull the image</summary>

Verify that the Kubernetes Cluster connector is configured correctly and that the cluster has network access to `pkg.harness.io`. Also confirm that the pipeline identity has read access to the registry.

</details>

***

## Next steps

* To build and upload artifacts to Harness Artifacts from CI pipelines, go to [Harness CI and Harness Artifacts](https://developer.harness.io/artifact-registry/3.0/platform-integrations/harness-ci.md).
* To manage registries as infrastructure as code with Terraform, go to [Terraform: creating registries as code](https://developer.harness.io/artifact-registry/3.0/platform-integrations/terraform.md).
* To configure client-side authentication for specific package types, go to the relevant page under [Setup](https://developer.harness.io/artifact-registry/3.0/setup/docker.md).
* To manage registries and artifacts from the CLI, go to [CLI reference](https://developer.harness.io/artifact-registry/3.0/reference/cli.md).

{% @harness-feedback/feedback %}
