microsoft / microsoft/azure-devops-python-api

No documentation on how to trigger pipeline build on 'master' branch.

Open
#290 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
684
Forks
218
Avg merge
8d 10h
Merged PRs (30d)
1

Description

import os
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication

Fill in with your personal access token and org URL

PERSONAL_ACCESS_TOKEN = os.getenv("PERSONAL_ACCESS_TOKEN")
ORGANIZATION_URL = 'xxxxxx'
PROJECT_NAME = "xxxxxx"

def create_pipeline_client():
# Get connection from devOps & create pipeline client
credentials = BasicAuthentication('', PERSONAL_ACCESS_TOKEN)
connection = Connection(base_url=ORGANIZATION_URL, creds=credentials)
pipeline_client = pipeline_client = connection.clients_v5_1.get_pipelines_client()
return pipeline_client

def build_pipeline():
pipeline_client = create_pipeline_client()
run_params = {'sourceBranch' : "master"}
pipe_id = 2098
pipeline_client.run_pipeline(
run_parameters=run_params,
project=PROJECT_NAME,
pipeline_id=pipe_id,
pipeline_version=None)
print("Pipeline run successfully activated.")

build_pipeline()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python example in the issue and locate the repository's existing documentation entry point. Document how to trigger a pipeline build for the master branch, using the shown Azure DevOps API flow; the documentation should explain the required configuration and resulting pipeline run.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
api, devops, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.