Skip to main content

Call Azure DevOps pipeline and optionally search output.

Project description

Overview

A Python module to call Azure DevOps pipeline and optionally search output.

Prerequisites

  • Python 3.9 or higher.

  • Azure DevOps PAT (Personal Access Token) with Builds (read and execute) permissions.

Usage

Installation:

pip3 install azdo_pipeline
# or
python3 -m pip install azdo_pipeline

Bash:

call_azdo_pipeline \
   -t "<pat>" \
   -o "<org>" \
   -p "<project_id>" \
   -l <pipeline_id> \
   [-d '<run_parameters>' \]
   [-r <run_id> \]
   [-g <log_id> \]
   [-s "<search_pattern>"]

Example:

call_azdo_pipeline \
   -t "sd354sd36f5sf4s6v4s" \
   -o "my-org" \
   -p "asfj-349859njnkfv-dvdf-3rfsw" \
   -l 35 \
   -d '{"templateParameters": {"agentPool": "ubuntu-latest"}}' \
   -r 3210 \
   -g 6 \
   -s ".*SUCCESSFUL.*"

Retrieving pipeline run logs list...
Retrieving pipeline run log 9...
Extracting output from logs...
{ 'data': '2025-08-23T08:07:29.0226728Z SUCCESSFUL',
   'run_id': 3210,
   'status': 200}

Arguments

  • -t PAT (Personal Access Token) for Azure DevOps authentication.

  • -o Organization name in Azure DevOps.

  • -p Project ID or name in Azure DevOps.

  • -l Pipeline ID in Azure DevOps.

  • -d (Optional) JSON string with run parameters.

  • -r (Optional) Specific run ID to fetch logs from.

  • -g (Optional) Specific log ID to fetch.

  • -s (Optional) Regex pattern to search for in the logs.

Return Value

A dictionary with the following keys:

  • data: The matched log line or an empty string if no match is found.

  • run_id: The ID of the pipeline run.

  • status: The HTTP status code of the API response.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azdo_pipeline-1.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azdo_pipeline-1.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file azdo_pipeline-1.0.2.tar.gz.

File metadata

  • Download URL: azdo_pipeline-1.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

File hashes

Hashes for azdo_pipeline-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ec84bf8490f87c2641026078f2e72b65295d922d16d2fb5b2ae8a1455d8950a7
MD5 4969d3046ff32f93580c6f665ae64088
BLAKE2b-256 d92eb429424f1a9a778bcef1298926040d78fd2487d77b3f578d594c92e2dea0

See more details on using hashes here.

File details

Details for the file azdo_pipeline-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: azdo_pipeline-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

File hashes

Hashes for azdo_pipeline-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31237be04ccd56dda23c2aac294886702cb709dc40fb4601c5d655e73e7d1cf5
MD5 51e61cf451d0499ba6bccc1c3924c90e
BLAKE2b-256 5f9099d458eebdd2a2ef221b61e3f70cc2b0ef22e4f73a998a39704cebdd06cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page