Azure 以管理员身份开发交互式代理 [英] Azure devops interactive agent as admin

查看:17
本文介绍了Azure 以管理员身份开发交互式代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在交互模式下运行 Azure Devops 代理的 Windows 10 企业虚拟机.代理使用机器拥有的唯一用户运行,并且它是禁用 UAC 的管理员.但是,在执行需要提升命令提示符的任务时,如注册 dll,该命令会失败并显示以下错误消息:

I have a Windows 10 Enterprise VM running an Azure Devops Agent in Interactive mode. The agent runs using the only user the machine has, and it is an Administrator with UAC disabled. However, when executing tasks that require an elevated command prompt, as registering dlls, the command fails with the following error message:

##[error]Cmd.exe exited with code '5'.

当我尝试将文件复制到 Windows\SysWow64 时,就会出现此消息

And this message is when I'm trying to COPY files into Windows\SysWow64

##[error]Error: Failed cp: cp: copyFileSync: could not write to dest file (code=EPERM):C:\windows\SysWow64\test.txt

我的睾丸也失败并显示以下错误消息:

My testes also fail with the following error message:

Test method TestesRegressaoPGB.Autenticacao.AutenticarNoPGBL02 threw exception:
System.AggregateException: One or more errors occurred. (The requested operation requires elevation.) ---> System.ComponentModel.Win32Exception: The requested operation requires elevation.
TestCleanup method TestesRegressaoPGB.Autenticacao.Cleanup threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..

如何在提升时运行所有命令?

How do I run all commands while elevated?

推荐答案

我刚刚为管道代理需要打开的每个文件夹添加了权限.正如我对 Vito 所说的,代理没有使用服务帐户运行.

I just added permissions on each and every folder the pipeline agent needed to open. As I said to Vito, the agent was not running using a service account.

这篇关于Azure 以管理员身份开发交互式代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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