azure-devops-python-api | Azure DevOps Python API | Azure library
kandi X-RAY | azure-devops-python-api Summary
kandi X-RAY | azure-devops-python-api Summary
This repository contains Python APIs for interacting with and managing Azure DevOps. These APIs power the Azure DevOps Extension for Azure CLI. To learn more about the Azure DevOps Extension for Azure CLI, visit the Microsoft/azure-devops-cli-extension repo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a request message
- Retrieve resource locations for a given URL
- Return a resource location
- Get the deployment url from the normalized url
- Returns a client instance
- Get the resource area for a given resource
- Returns the URL for a client instance
- Import a class by full name
- Load the cache from disk
- Read a base64 encoded file
- Safely parse a JSON object
- Get a JSON object from a file
- Get information about a given remote URL
- Return the cache directory
- Gets the VST info for a given remote URL
- Execute a shell command
- Unwrap a collection from the response
azure-devops-python-api Key Features
azure-devops-python-api Examples and Code Snippets
def find_cuda_config():
"""Returns a dictionary of CUDA library and header file paths."""
libraries = [argv.lower() for argv in sys.argv[1:]]
cuda_version = os.environ.get("TF_CUDA_VERSION", "")
base_paths = _list_from_env("TF_CUDA_PATHS",
def get_all_configs():
"""Runs all functions for detecting user machine configurations.
Returns:
Tuple
(List of all configurations found,
List of all missing configurations,
List of all configurations found with warnings,
def validate_cuda_config(environ_cp):
"""Run find_cuda_config.py and return cuda_toolkit_path, or None."""
def maybe_encode_env(env):
"""Encodes unicode in env to str on Windows python 2.x."""
if not is_windows() or sys.version_info[0] !
Community Discussions
Trending Discussions on azure-devops-python-api
QUESTION
I am able to use Azure Rest API in Python (https://github.com/microsoft/azure-devops-python-api) to get a download URL for an Artifact e.g.
...ANSWER
Answered 2022-Jan-21 at 04:53We have API version 6.0 for python package download for Azure DevOps Artifacts:
Below is the API, this can be used in any UI
QUESTION
I am trying to get a list of dashboards using azure-devops-python-api. I can't figure out how to connect the libraries correctly to get the list of dashboards and work with them. What I've done is this:
...ANSWER
Answered 2022-Jan-10 at 12:09You can use the below Python script to list the dashboards in a particular project using python.
Here is the python code:
QUESTION
I’m trying to link automated test results from a pipeline task PublishTestResults, to test cases in azure. That way I am able view the history of the test results through the test case
Background
These tests are automated with pytest and generate a Junit XML report to Azure. Please correct me if I am wrong but from what I found, there isn’t an argument or option or setting where azure is able to link these test cases automatically. Also the XML format Azure expects doesn’t contain a attribute for the id. https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=trx%2Cyaml
I can’t associate these tests through visual studio since pytest is not supported. https://docs.microsoft.com/en-us/azure/devops/test/associate-automated-test-with-test-case?view=azure-devops
Problem
I started using the Azure REST API and the azure devops python api, https://github.com/microsoft/azure-devops-python-api . Got my build id, test run id associated to the pipeline build, test run from the id, test case id, and the test point id. Doing a GET Test Result returns the test result, and focusing on a particular object of the response.
...ANSWER
Answered 2021-Nov-03 at 21:02I posted to Visual Studio Developer Community Forum.
We pretty much have to go through the "Update Work Item" route. In order to link the automated test results with a test case, I added a relation link to the test result:
QUESTION
I have an existing Devops pipeline that trains ML models. To guaranty the robustness for the models, it will be necessary to retrain it periodically. For this I decided to create an Azure function that will be executed each month. will It collect the new data, apply the data pre-processing and finally trigger the Azure Devops training pipeline. All of this must be done with python. By doing a research, I understood that this can be done using REST Azure Devops API request. I founded this python git repo https://github.com/microsoft/azure-devops-python-api which provides an API to communicate with Azure DevOps. I executed the code provided by this package which displays the list of my devops projects. But I can't found how trigger the pipeline. Assuming that my organisation named ORGA1, the project named PROJ1 and the pipeline that I want ti execute named PIPELINE1, How can I launch it using an Azure function or even a simple python script ? PS: I am using a python 3.9 Timer Trigger Azure function. Thank you in advance for your help.
EDIT
I tired to use LOGIC APP to do this like @mohammed described in the comment and I think that this is a good solution. Above the workflow that I created:
So I launch the logic app each X hours, this will trigger the azure Devops, and ASA it end training with Success it will send me an email. I have one error here, is that I am creating a new release and not triggering a specific pipeline each time. But navigating in the different actions under the devops service, I cannot found any thing related to launching a devops pipeline. Can anyone have an idea how to do it.
...ANSWER
Answered 2021-Jun-18 at 01:15You can use a Logic App with a timer to trigger your DevOps pipeline instead of an Azure function, as it has all the built-in connectors required to interface with your DevOps. See : https://www.serverlessnotes.com/docs/keep-your-team-connected-using-azure-devops-and-azure-logic-apps
QUESTION
I am trying to find documentation on how to use Azure DevOps Python API in order to download universal packages from Azure private feeds.
Has anyone did it before using a python script?
...ANSWER
Answered 2021-Mar-31 at 01:29I am afraid downloading Azure universal packages using Azure DevOps Python API is not support yet. For the NPM, Maven, Nuget and Pyton Artifacts package types there is an API which allows directly downloading of a packages, but not for Azure universal packages.
The user voice regarding this request has been submit to Microsoft Development team. You can vote it up, or create one for yourself.
Currently, you will have to download it using Azure CLI.
az artifacts universal download --organization https://dev.azure.com/Fabrikam --feed FabrikamFiber --name my-first-package --version 1.0.0 --path .
See here for more information.
QUESTION
I have two repos on Azure DevOps, let's call them parent_repo
and child_repo
. The child_repo
is a fork of the parent. What I'd like to do is create a PR to merge master
of child_repo
to master
of parent_repo
using the Azure DevOps Services API, by way of its Python library.
According to these docs and this thread, forkSource
is the parameter needed to indicate that the source branch is in a fork, and to provide the repo_id
of that fork.
ANSWER
Answered 2020-Jul-08 at 09:44Okay, I dug a little deeper into the docs, starting here with forkSource
. Following that link into here then here it became apparent that forkSource
has to be formulated like so:
"forkSource": {"repository": {"id": child_repo_id}}
Oddly, the DevOps API was ignoring the nested repository
param instead of (preferably) throwing an error. This change resolves the issue and creates a PR resembling the one I'm after.
Full code:
QUESTION
So, from what I see from most sources, they say if youre trying to make a python program call azure devops api calls, it uses a python import statement such as :
...ANSWER
Answered 2020-Feb-21 at 22:50Surely, it is supported to use requests
to call Azure DevOps REST API
Firstly, you need to create a personal access token (PAT)
Then you can use the PAT to create the basic auth header, and make the request:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-devops-python-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page