azure devops本地代理管道许可被拒绝 [英] azure devops local agent pipeline permission denied

查看:59
本文介绍了azure devops本地代理管道许可被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个python脚本,可以在远程SUT上执行自动化脚本.并考虑到该脚本在使用用户测试仪和密码xxx在本地执行时可以正常工作.

I have a python script that execute an automation script on remote SUT. and given that the script is working when execute locally with user tester and password xxx.

在构建DevOps Azure管道时,我已将项目从GIT签出到代理中,然后尝试从命令行执行代码.

when I build the DevOps Azure pipeline I have checkout from GIT the project into the agent and then try to execute the code from the command line .

cd .\MatrixPro\TestFramework
python .\main.py -t profaund_tests.matrix_pro_rf_energy_across_impedances 

此代码给了我一个错误

E PermissionError:[WinError 5]访问被拒绝:'//192.168.1.100\c $ \'

E PermissionError: [WinError 5] Access is denied: '//192.168.1.100\c$\'

似乎此脚本试图在SUT上创建报告文件,并且没有权限.

seems that this script try to create report file on the SUT and doesn't have permission.

此外,azure用户代理具有管理员权限,但我怀疑在执行命令之前需要更改为本地用户.

more over that the azure user agent have admin permission but I suspect that I need to change into the local user before execute the command.

注意:我正在Windows 10上工作.

note: I'm working on windows 10 .

什么是解决此问题的正确方法?如何找出此错误的发生方式?

what is the right method to solve this issue ? how can I figure out way this error occur ?

他们是更改管道渗透率以使用本地用户和密码在本地代理上工作的简单方法吗?

is their a simple way to change the pipeline permmision to work on local agent with local user and password?

推荐答案

在Azure DevOps上运行生成管道时.

When you run the build pipeline on Azure DevOps.

实际上是运行脚本的构建服务帐户.您应该确保构建服务帐户具有足够的访问权限:'//192.168.1.100\c $ \'

It's actually the build service account which is running the script. You should make sure the build service account have sufficient permission to Access: '//192.168.1.100\c$\'

要更改构建代理的身份,只需进入Windows服务并更改相关构建服务的身份(服务名称为"Azure Pipelines代理").

To change the identity of the build agent, just go into Windows Services and change the identity of related Build service (service name is " Azure Pipelines Agent").

  1. 服务窗格中,右键单击 Azure Pipelines代理.
  2. 服务状态下,单击停止.
  3. 点击登录标签.
  4. 此中指定要用于该服务的帐户帐户文本框.
  5. 密码文本框中键入新密码,然后键入确认密码文本框中再次输入新密码.
  6. 在服务状态"下,单击开始.

  1. In the Services pane, right-click Azure Pipelines Agent.
  2. Under Service Status, click Stop.
  3. Click the Log On tab.
  4. Specify the account you want to use for the service in the This account text box.
  5. Type the new password in the Password text box, and then type the new password again in the Confirm password text box.
  6. Under Service Status, click Start.

您应该使用一个用户来远程访问该服务器拥有构建代理的位置,并手动运行该脚本以执行部署过程.如果该用户能够成功部署而没有任何权限问题.只需将此用户用作Azure DevOps代理的生成服务帐户即可.

You should use a user to remote to that the server hold build agent and manually run the script to perform the deploy process. If that user is able to deploy succeed without any permission issue. Simply use this user as your build service account of Azure DevOps agent.

希望这会有所帮助.

这篇关于azure devops本地代理管道许可被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆