---
title: Microsoft Azure DevOps Server version tags
description: Use an Azure DevOps Server service hook to tell Coralogix when a new build completes, so version benchmarks line up with your deployments.
url: https://coralogix.com/docs/developer-portal/apis/version-tags/microsoft-azure-devops-server-version-tags/
product: cicd
feature: Version Tags
feature_id: version-tags
feature_identifier: cicd/version-tags
last_updated: '2026-10-12'
---

# Microsoft Azure DevOps Server version tags

Tell Coralogix when a new build ships, straight from your Azure DevOps Server pipeline. A service hook on build completion creates a version tag, which is what version benchmark reports compare behavior across.

## What you need

* Access to your Azure DevOps Server team project's settings.
* A personal or team [API key](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md) with the `CICDIntegration` preset. Presets pick up new permissions automatically; individual permissions have to be maintained by hand.
* The Azure DevOps version tags endpoint for your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md). Use the domain selector at the top of this page to resolve it:
  <!-- -->
  https\://api./api/v1/external/tfs?application=YOUR\_APPLICATION\_NAME\&subsystem=YOUR\_SUBSYSTEM\_NAME\&name=YOUR\_TAG\_NAME

| Preset          | Actions                                                                                                   | Grants                                                                                             |
| --------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| CICDIntegration | `VERSION-BENCHMARK-TAGS:READ`<br />`VERSION-BENCHMARKS-REPORTS:READ`<br />`VERSION-BENCHMARK-TAGS:UPDATE` | View version benchmark tags<br />View version benchmark reports<br />Modify version benchmark tags |

## Create the service hook

1

<!-- -->

.

Open service hooks

Sign in to Azure DevOps Server, select your team project, then **Settings**, then **Service hooks**.

2

<!-- -->

.

Add a web hook

Select **Add new service hooks**, then **Web Hooks**.

3

<!-- -->

.

Trigger on completed builds

Select **Build Completed** as the trigger, set **Build status** to **Succeeded**, and select **Next**. Add any further filters you want.

4

<!-- -->

.

Point it at Coralogix

Enter the Azure DevOps version tags endpoint for your domain, with the query parameters below.

| Parameter     | What to enter                                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `application` | Required. Must match your logs [application name](https://coralogix.com/docs/user-guides/account-management/account-settings/application-and-subsystem-names.md) exactly                  |
| `subsystem`   | Must match your logs [subsystem name](https://coralogix.com/docs/user-guides/account-management/account-settings/application-and-subsystem-names.md). Separate multiple names with commas |

5

<!-- -->

.

Authorize the request

Add a header carrying your API key, then select **Finish**.

```
Authorization: Bearer <cx_api_key>
```

## Send deployment events

Send each deployment to the Coralogix ops events API as well, and it appears as an [event marker](https://coralogix.com/docs/user-guides/apm/features/event-markers.md) on your APM charts, so you can line a latency or error-rate change up with the pipeline run that caused it. This uses a step in a YAML pipeline running on a Linux agent.

### What you need

* A **Send Your Data** [API key](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md#create-an-api-key) with the **OpsEvents** role preset. The ops events API rejects any other key type or preset, including the `CICDIntegration` key used for version tags, with `403 Forbidden`.
* The ops events endpoint for your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md). Use the domain selector at the top of this page to resolve it:
  <!-- -->
  https\://ingress./v1/ops-events
* The service name and environment exactly as they appear in APM. They must equal the `service.name` and `deployment.environment.name` resource attributes your service reports. An event that matches no service is still stored, but appears only under **All events**.

### Add the step to your pipeline

Store the API key as a secret pipeline variable named `CX_OPS_EVENTS_API_KEY`. Azure Pipelines does not expose secret variables to scripts automatically, so the step maps it into `env`. Add the step as the last step of your deployment job; `condition: always()` makes it run when the deployment fails too, and `Agent.JobStatus` carries the result.

```
- bash: |

    case "$AGENT_JOBSTATUS" in

      Succeeded|SucceededWithIssues) STATUS=PIPELINE_RESULT_STATUS_SUCCESS ;;

      Canceled) STATUS=PIPELINE_RESULT_STATUS_CANCELLATION ;;

      *) STATUS=PIPELINE_RESULT_STATUS_FAILURE ;;

    esac

    case "$BUILD_SOURCEBRANCH" in

      refs/tags/*) REF_TYPE=VCS_REF_TYPE_TAG ;;

      *) REF_TYPE=VCS_REF_TYPE_BRANCH ;;

    esac

    curl -sS --fail-with-body -X POST 'https://ingress.eu2.coralogix.com/v1/ops-events' \

      -H "Authorization: Bearer $CX_API_KEY" \

      -H 'Content-Type: application/json' \

      --data-binary @- <<EOF

    {

      "opsEvent": {

        "timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",

        "description": "$SERVICE_NAME $BUILD_SOURCEVERSION deployed to $ENVIRONMENT",

        "attributes": {

          "service": { "name": "$SERVICE_NAME" },

          "environment": "$ENVIRONMENT"

        },

        "cdEvent": {

          "system": "CD_SYSTEM_AZURE_DEVOPS",

          "pipeline": {

            "name": "$BUILD_DEFINITIONNAME",

            "run": {

              "id": "$BUILD_BUILDID",

              "url": "${SYSTEM_COLLECTIONURI}${SYSTEM_TEAMPROJECTID}/_build/results?buildId=$BUILD_BUILDID"

            },

            "result": { "status": "$STATUS" }

          },

          "vcs": {

            "type": "$REF_TYPE",

            "repository": { "name": "$BUILD_REPOSITORY_NAME", "url": "$BUILD_REPOSITORY_URI" },

            "ref": { "head": { "name": "$BUILD_SOURCEBRANCHNAME", "revision": "$BUILD_SOURCEVERSION" } }

          }

        }

      }

    }

    EOF

  displayName: Send deployment event to Coralogix

  condition: always()

  env:

    CX_API_KEY: $(CX_OPS_EVENTS_API_KEY)

    SERVICE_NAME: <service_name>

    ENVIRONMENT: <environment>
```

Replace `<service_name>` and `<environment>` with the values from APM.

A successful request returns the server-generated event `id`. The marker then appears on the service's APM charts; see [Event markers](https://coralogix.com/docs/user-guides/apm/features/event-markers.md) for how to show it and for the full field reference. The API rejects a `timestamp` more than 24 hours from the time the request is received, so send the event from the pipeline as it runs rather than backfilling.

## Related resources

[Coralogix endpoints](https://coralogix.com/docs/integrations/coralogix-endpoints.md)[API keys](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md)[Application and subsystem names](https://coralogix.com/docs/user-guides/account-management/account-settings/application-and-subsystem-names.md)
