Using Azure DevOps for Private Go Modules
This took a few hours of work to iron out, so figured maybe I’d save someone time.
⚡ Just keep it simple and use SSH
dev.azure.com even if using older
project.visualstudio.com to keep things simple.
Unlike GitHub, Azure DevOps has some quirks to deal with, specifically in the odd path handling.
My original goal was to set the default handling to be
https support, with the SSH override in git config allowing me to use SSH.
This didn’t work.
- HTTPS requires
_gitin the path.
- SSH will not work with that, and also trims out the org name in the url when git config set based on instructions from Microsoft1.
There is a long-running issue with go get imports of Azure DevOps repositories due to the fact that the HTTPS URL contains a
Compare the path.
|⚡ What I used with SSH|
Set this in your
.profile, .bashrc, or $PROFILE
There are two approaches you can take.
One seems focused on allowing other
dev.azure.com public projects to be used.
I’ve never had that need, so I’m ok with my
dev.azure.com references being resolved only to my own organization.
|Support All Azure DevOps (Public)|
|⚡ What I Used for Private Org|
If you don’t have restrictions on this, then you can do https with the following command to add the token in or use a more complex credential manager based process.