microsoft / azure-devops-go-api

This repository contains Go APIs for interacting with and managing Azure DevOps.
https://docs.microsoft.com/en-us/azure/devops/integrate/index?view=azure-devops
MIT License
187 stars 78 forks source link

Alternative of PAT for authentication? #142

Closed ceng-p closed 5 months ago

ceng-p commented 11 months ago

Hello!

Is there a different way to authenticate to the library other than PAT? Ideally I'd like to create a manged identity or service principal instead

DariuszPorowski commented 9 months ago

@ceng-p

connection := azuredevops.NewPatConnection(organizationUrl, accessToken)

For the reference you can use Azure DevOps Auth samples https://github.com/microsoft/azure-devops-auth-samples/tree/master/ServicePrincipalsSamples, it's .NET but logic is the same.