https://github.com/martins-vds/poc-azure-devops-api-automation
This project is a Proof of Concept (PoC) to automate the Azure DevOps API using OAuth2.0 authentication with client credentials flow and Postman.
https://github.com/martins-vds/poc-azure-devops-api-automation
azure-ad azure-devops-api microsoft-graph-sdk oauth2 postman postman-collection powershell-core
Last synced: 10 months ago
JSON representation
This project is a Proof of Concept (PoC) to automate the Azure DevOps API using OAuth2.0 authentication with client credentials flow and Postman.
- Host: GitHub
- URL: https://github.com/martins-vds/poc-azure-devops-api-automation
- Owner: martins-vds
- License: unlicense
- Created: 2023-09-25T21:56:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T17:54:30.000Z (about 2 years ago)
- Last Synced: 2025-01-15T22:42:38.165Z (11 months ago)
- Topics: azure-ad, azure-devops-api, microsoft-graph-sdk, oauth2, postman, postman-collection, powershell-core
- Language: PowerShell
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PoC - Azure DevOps Api Automation
## Table of Contents
- [PoC - Azure DevOps Api Automation](#poc---azure-devops-api-automation)
- [Table of Contents](#table-of-contents)
- [Disclaimer](#disclaimer)
- [Description](#description)
- [Pre-requisites](#pre-requisites)
- [How to use](#how-to-use)
## Disclaimer
This project is a Proof of Concept (PoC) and is not intended to be used in production environments. The code is provided as-is with no warranties and it is the responsibility of the user to test and validate the code before using it in a production environment.
## Description
This project is a Proof of Concept (PoC) to automate the Azure DevOps API using OAuth2.0 authentication with client credentials flow and Postman.
## Pre-requisites
- [Postman](https://www.postman.com/downloads/)
- [PowerShell 7.3](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3)
- [Microsoft Graph PowerShell SDK](https://docs.microsoft.com/en-us/graph/powershell/installation)
## How to use
1. Clone this repository
2. Open the PowerShell 7.3 and the script below:
```powershell
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
.\Setup-POC.ps1 -TenantId "" -AppName ""
```
Replace the parameters with the appropriate values:
- **TenantId**: Azure AD Tenant Id
- **AppName**: Azure AD Application Name to be created
The script will ask for a certificate password so a self-signed X509 certificate can be created and exported to the current directory. An Azure AD Application will be created with that certificate as credential.
The script will also create in the current directory a Postman collection with the appropriate values to be used in step 4. The collection file will have the same name as the Azure AD Application.
3. Go to your Azure DevOps Organization and add as a user the Azure AD application created in the previous step. For that, go to `Organization Settings` > `Users` > `Add users` > `Search for the Azure AD Application`. Keep the access level as `Basic`, select the appropriate projects you want to give access to, uncheck the box `Send email invites (to Users only)` and click on `Add`.
4. Open the Postman and import the collection created in the step 2. To do that, click on `Import` > `Files` and select the collection file.
5. Run the collection and check the results