You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However I would like to make the scripts not require storing a pat in clear text. I'd like to do similar to "az login" - if the current session doesn't have auth token in keychain, open the browser to get one and then use that for future calls. Is this feasible today?
If not feasible, what is the recommended way to safely store pats for use in scripts?
The text was updated successfully, but these errors were encountered:
I'd love it if there was an easy way to get the PAT after az login. If you know of one, or see any environment variable change, I could probably change the way things work here.
As far as the general question goes...
I have some very old solutions for this that will work on Windows, but I'm not going to spend my time explaining them.
Instead, I'll redirect you to the modern / official answer on this, from the PowerShell team:
I would like to write scripts to automate various devops tasks for developers. I'm able to do so with a personal access token, like this:
$pat = get-content .devopspat -ErrorAction SilentlyContinue
$_=Connect-ADO -Organization $org -PersonalAccessToken $pat -UseDefaultCredentials -ErrorAction Stop
However I would like to make the scripts not require storing a pat in clear text. I'd like to do similar to "az login" - if the current session doesn't have auth token in keychain, open the browser to get one and then use that for future calls. Is this feasible today?
If not feasible, what is the recommended way to safely store pats for use in scripts?
The text was updated successfully, but these errors were encountered: