We have on on premise azure devops server and I'm converting a bunch of Mercurial repositories to it. It's too many to do manually so scripting it with the az devops extensions.
Creating the repos works great.
function createproject
{
az devops project create --name=$1
pushd $2
rm -rf .hg
rm -f .hgignore
git init
git remote add origin https://server.com/projects/$1/_git/$1
git add .
git commit -m "initial commit"
git push origin master
popd
}
for dir in ./*/ ;
do
echo ${dir:2:-1}
createproject ${dir:2:-1} $dir
done
But the project gets some default team and I need to add individual users to the projects.
az devops project show --project=Project
"defaultTeam": {
"id": "77f27a5c-1a1f-49cc-a6be-f14474e88929",
"name": "ProjectTeam",
"url": "https://url/fipsg_projects/_apis/projects/8d96eb91-0db4-4a10-8ce2-6066c13487c3/teams/77
How to to add individual users to the repos/team?
for dir in ./*/ ;
do
echo ${dir:2:-1}
adduser ?????? ${dir:2:-1} $dir
done

