[英]TFS Build “PowerShell on Target Machines” Step Fails: How to debug?
I'm trying to automate the deployment of the solution my team is working on through TFS Build server. 我正在尝试通过TFS Build服务器自动化团队正在研究的解决方案的部署。 One of the steps which executes a PowerShell script on the target machine fails with the following error:
在目标计算机上执行PowerShell脚本的步骤之一失败,并显示以下错误:
Microsoft ODBC Driver 11 for SQL Server : Login failed for user 'sa'..
The PowerShell script I'm trying to execute does in fact connect to multiple databases using the sa credentials. 实际上,我尝试执行的PowerShell脚本确实使用sa凭据连接到多个数据库。 When I try to execute the same script passing it the exact same arguments by hand (ie: executing the script from the target machine VM itself) it works like a charm.
当我尝试执行相同的脚本并通过手工传递完全相同的参数(即:从目标计算机VM本身执行脚本)时,它就像一个符咒。 But when it is being executed as part of the build steps it fails with the aforementioned error.
但是,当将其作为构建步骤的一部分执行时,它会因上述错误而失败。
Is there a way to further debug the issue? 有没有办法进一步调试问题? It would be great if there is a way to output trace statements from the script so I could have some insight on what is actually going on.
如果有一种方法可以从脚本输出跟踪语句,那将很好,这样我就可以对实际发生的事情有一些了解。
Usually all the related error should reflect in TFS build log. 通常,所有相关错误应反映在TFS构建日志中。 To narrow your issue you can try to connect to the TFS build agent with the credentials used for the build service and manually run the ps script.
要缩小问题的范围,您可以尝试使用用于构建服务的凭据连接到TFS构建代理,然后手动运行ps脚本。
If you execute the ps script with your own account, which will not help to the issue. 如果您使用自己的帐户执行ps脚本,则无济于事。 Usually this kind of problems is related to permissions.
通常,这类问题与权限有关。 Your build service account are lack of related permission.
您的构建服务帐户缺少相关权限。 Try to add it to Administrator or SQL Administrator group and execute the build again.
尝试将其添加到Administrator或SQL Administrator组,然后再次执行构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.