0

I'm trying to execute a powershell script XYZ.ps from an Powershell task which is in a TFS Build Definition. The Build Definition is executed with UserA and this UserA does not have permission to Read/Write SQL that the script XYZ.ps executes.

For this reasons, I'm exploring PATS (Personal Access Tokens) which can be created for UserB (who has permissions to execute SQL that the script XYZ.ps executes) so that this UserB can be used to execute ps script XYZ.ps. I can see a lot of the references to using PATS only for rest-api but how can PATS be used

(1) by calling a powershell script with PATS (2) or by passing the specific PAT to powershell script and then using it in the script (3) or any other way to use a PAT with a powershell script.

Base line is that inspite of researching, I don't understand how to use a PAT for my requirement - please help !

3
  • I don't think a PAT will solve anything in this case. You'll need the creds for user B to talk to SQL. The PAT will only help you talk to Azure DevOps. Commented May 25, 2021 at 9:18
  • oh ok! thank you for this information ! so it will not even work if i send the PAT to access token in SQL for "Provider=MSOLEDBSQL;Data Source=myServer;Initial Catalog=myDatabase; Access Token=myAccessToken;Use Encryption for Data=true;" ? @jessehouwing ? Commented May 26, 2021 at 4:44
  • No. The Personal Access Token for Azure DevOps has nothing to do with a SQL username/password. Commented May 26, 2021 at 8:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.