Package: azure-functions-devops-build
Azure Devops Build Manager For Azure Functions:construction: The project is currentlywork in progress. Pleasedo not use in productionas we expect developments over time. :construction:This project provides the class AzureDevopsBuildManager and supporting classes. This manager class allows
the caller to manage Azure Devops pipelines that are maintained within an Azure Devops account. This project was created to be able to support command line tooling for the AZ Cli.InstallTo install the package from pip:pip install azure-functions-devops-buildGet startedTo use the API, you need to first establish a connection to azure by loging into your azure account usingaz login. You can then follow the example as below. Firstly we get the token from login and use this to authenticate the different python function calls.fromazure.cli.coreimportget_default_clifromazure.cli.core._profileimportProfilefromazure_functions_devops_build.organization.organization_managerimportOrganizationManagerimportpprint# Get your token from the az login cachecli_ctx=get_default_cli()profile=Profile(cli_ctx=cli_ctx)creds,_,_=profile.get_login_credentials(subscription_id=None)# Create an organization manager using your credentialsorganization_manager=OrganizationManager(creds=creds)# Get the list of organizations for your userorganizations=organization_manager.list_organizations()# Show details about each organization in the consolefororganizationinorganizations.value:pprint.pprint(organization.__dict__)API documentationThis Python library extensively uses the Azure DevOps REST APIs and Azure Devops Python API. See theAzure DevOps REST API referencefor details on calling different APIs andAzure DevOps Python SDKfor details on the azure-devops-python-api.SamplesSee samples by looking at tests or viewing theaz-cli functionapp devops-build module.TestingSeveral things need to be setup before you can run the tests:Signed into the az cli. You can do this by usingaz login.Since this directly deploys to azure functions,create an azure functions functionapp using the azure portal. You need to make a functionapp for these tests to successfully run and make sure you record the details of the subscription name, project name, application type and storage name.Follow the tests/_config_example.py file, create a tests/_config.py with your own testing environment.Run the full test suite usingpython -m tests.suiteTo run specific manager tests runpython -m tests.{NAME_OF_MANAGER}eg.python -m tests.test_builder_managerContributingThis project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visithttps://cla.microsoft.com.When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor
contactopencode@microsoft.comwith any additional questions or comments.