1Metadata-Version: 2.1 2Name: azure-functions-devops-build 3Version: 0.0.22 4Summary: Python package for integrating Azure Functions with Azure DevOps. Specifically made for the Azure CLI 5Home-page: https://github.com/Azure/azure-functions-devops-build 6Author: Oliver Dolk, Hanzhang Zeng 7Author-email: t-oldolk@microsoft.com, hazeng@microsoft.com 8License: MIT 9Description: # Azure Devops Build Manager For Azure Functions 10 11 > :construction: The project is currently **work in progress**. Please **do not use in production** as we expect developments over time. :construction: 12 13 This project provides the class AzureDevopsBuildManager and supporting classes. This manager class allows 14 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. 15 16 ## Install 17 To install the package from pip: 18 ``` 19 pip install azure-functions-devops-build 20 ``` 21 ## Get started 22 To use the API, you need to first establish a connection to azure by loging into your azure account using `az 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. 23 24 ```python 25 from azure.cli.core import get_default_cli 26 from azure.cli.core._profile import Profile 27 from azure_functions_devops_build.organization.organization_manager import OrganizationManager 28 import pprint 29 30 # Get your token from the az login cache 31 cli_ctx = get_default_cli() 32 profile = Profile(cli_ctx=cli_ctx) 33 creds, _, _ = profile.get_login_credentials(subscription_id=None) 34 35 # Create an organization manager using your credentials 36 organization_manager = OrganizationManager(creds=creds) 37 38 # Get the list of organizations for your user 39 organizations = organization_manager.list_organizations() 40 41 # Show details about each organization in the console 42 for organization in organizations.value: 43 pprint.pprint(organization.__dict__) 44 ``` 45 46 ## API documentation 47 48 This Python library extensively uses the Azure DevOps REST APIs and Azure Devops Python API. See the [Azure DevOps REST API reference](https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-5.0) for details on calling different APIs and [Azure DevOps Python SDK](https://github.com/Microsoft/azure-devops-python-api) for details on the azure-devops-python-api. 49 50 ## Samples 51 52 See samples by looking at tests or viewing the [az-cli functionapp devops-build module](https://github.com/Azure/azure-cli/tree/dev/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice). 53 54 ## Testing 55 56 Several things need to be setup before you can run the tests: 57 1. Signed into the az cli. You can do this by using `az login`. 58 2. Since this directly deploys to azure functions, [create an azure functions functionapp using the azure portal](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function). 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. 59 3. Follow the tests/_config_example.py file, create a tests/_config.py with your own testing environment. 60 4. Run the full test suite using `python -m tests.suite` 61 5. To run specific manager tests run `python -m tests.{NAME_OF_MANAGER}` eg. `python -m tests.test_builder_manager` 62 63 ## Contributing 64 65 This project welcomes contributions and suggestions. Most contributions require you to agree to a 66 Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 67 the rights to use your contribution. For details, visit https://cla.microsoft.com. 68 69 When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 70 a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 71 provided by the bot. You will only need to do this once across all repos using our CLA. 72 73 This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 74 For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 75 contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 76 77Keywords: Microsoft,Azure DevOps,Azure Functions,Azure Pipelines 78Platform: UNKNOWN 79Description-Content-Type: text/markdown 80