microsoft / microsoft/azure-devops-python-api
No documentation on how to trigger pipeline build on 'master' branch.
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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