Get Azure DevOps Repositories
Script that connects to Azure DevOps API using the client for Node.js and gets some repository information.
This SDK can be useful for large migrations that require automated commands on a large number of repositories.
Getting Started
# project setup
cp .env.example .env
# run it
yarn install
yarn start
Steps to create .env file
You'll need to provide the following configuration:
- AZURE_ORG_URL - This is the URL pointing to your Organization root (e.g. https://dev.azure.com/yourorgname).
- AZURE_PERSONAL_ACCESS_TOKEN - Create a PAT in your Azure DevOps profile (Follow the documentation).
- AZURE_PROJECT_NAME - This is the plain name of the project in Azure, also part of the URL of repositories.
Output
The script returns the repository URLs. Example:
The script found 3 repositories:
private https://epomatti@dev.azure.com/epomatti/Test/_git/repo1
private https://epomatti@dev.azure.com/epomatti/Test/_git/repo2
private https://epomatti@dev.azure.com/epomatti/Test/_git/repo3
References
Create a Personal Access Token