• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

azure_functions_devops_build/H14-May-2019-2,6171,907

azure_functions_devops_build.egg-info/H03-May-2022-8060

LICENSEH A D26-Mar-20191.1 KiB2217

MANIFEST.inH A D09-Apr-201986 32

PKG-INFOH A D14-May-20194.9 KiB8060

README.mdH A D14-May-20193.9 KiB6849

setup.cfgH A D14-May-201942 53

setup.pyH A D14-May-20191.3 KiB3725

README.md

1# Azure Devops Build Manager For Azure Functions
2
3> :construction: The project is currently **work in progress**. Please **do not use in production** as we expect developments over time. :construction:
4
5This project provides the class AzureDevopsBuildManager and supporting classes. This manager class allows
6the 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.
7
8## Install
9To install the package from pip:
10```
11pip install azure-functions-devops-build
12```
13## Get started
14To 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.
15
16```python
17from azure.cli.core import get_default_cli
18from azure.cli.core._profile import Profile
19from azure_functions_devops_build.organization.organization_manager import OrganizationManager
20import pprint
21
22# Get your token from the az login cache
23cli_ctx = get_default_cli()
24profile = Profile(cli_ctx=cli_ctx)
25creds, _, _ = profile.get_login_credentials(subscription_id=None)
26
27# Create an organization manager using your credentials
28organization_manager = OrganizationManager(creds=creds)
29
30# Get the list of organizations for your user
31organizations = organization_manager.list_organizations()
32
33# Show details about each organization in the console
34for organization in organizations.value:
35    pprint.pprint(organization.__dict__)
36```
37
38## API documentation
39
40This 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.
41
42## Samples
43
44See 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).
45
46## Testing
47
48Several things need to be setup before you can run the tests:
491. Signed into the az cli. You can do this by using `az login`.
502. 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.
513. Follow the tests/_config_example.py file, create a tests/_config.py with your own testing environment.
524. Run the full test suite using `python -m tests.suite`
535. To run specific manager tests run `python -m tests.{NAME_OF_MANAGER}` eg. `python -m tests.test_builder_manager`
54
55## Contributing
56
57This project welcomes contributions and suggestions.  Most contributions require you to agree to a
58Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
59the rights to use your contribution. For details, visit https://cla.microsoft.com.
60
61When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
62a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
63provided by the bot. You will only need to do this once across all repos using our CLA.
64
65This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
66For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
67contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
68