VSTS Name Change in Azure DevOps Effects on Git Repositories
The rebranding of VSTS to Azure DevOps has had an unexpected effect on Git repos. This tutorial will help you make sure your builds aren't breaking.
Join the DZone community and get the full member experience.
Join For Freeas i've said in the past, it is super easy to build a vsts build (now azure devops pipeline) to keep two repositories in sync . in that article, one of the steps is pushing the new code to the destination repositories with a url like https://$(token)@myaddress.visualstudio.com/defaultcollection , to automatically include a token to authenticate in the destination repository.
now, some of my builds have started to fail due to timeout and i immediately suspected the reason: the name change from vsts to azure devops changed the base url from accountname.visualstudio.com to dev.azure.com/accountname, and this broke the build.
due to the rebranding of vsts to azure devops and the change of url, you need to pay attention if an extension or build breaks due to use of the old url.
the solution is super simple. you need to go to the repository page of your account using the new dev.azure.com address and find the new address of the repository, something like https://accountname@dev.azure.com/accountname/teamproject/_git/repositoryname. you just need to change it, adding a semicolon and valid auth token after the account name, so it is like this: https://organization:$(token)/dev.azure ...
new string format to push force to a destination repository.
variable group linked to this build.
a simple variable group that contains a single secure variable.
since i have many mirror builds, i want a centralized way to securely store the token value to have all the builds take this value from a centralized location; the obvious solution is a variable group linked to this build.
in the variable group, i have a single variable called token, which is secure and used by many builds, so each time the token expires, i can change this and all the builds will use the new value.
that's all.
Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Reactive Programming
-
Decoding eBPF Observability: How eBPF Transforms Observability as We Know It
-
5 Common Data Structures and Algorithms Used in Machine Learning
-
New ORM Framework for Kotlin
Comments