[英]How to remove pipeline's access to self hosted agent (without the original PAT or access to the azure devops)?
Following are steps followed to setup the self hosted agent.以下是设置自托管代理的步骤。
./config.cmd
./config.cmd
Now the agent is ready to be used for release pipeline deployments.现在代理已准备好用于发布管道部署。 Now I want to remove the agent so I run
.\config remove
.现在我想删除代理,所以我运行
.\config remove
。 It asks me for the PAT which I don't remember.它要求我提供我不记得的 PAT。
I don't have access to the azure devops anymore (so cannot generate new PAT).我无法再访问 azure devops(因此无法生成新的 PAT)。 My goal (ad this question) is regarding removal of the agent service from the machine.
我的目标(广告这个问题)是关于从机器上删除代理服务。 Whether or not it removes the agent from the azure devops is irrelevant.
它是否从 azure devops 中删除代理是无关紧要的。 Any advise?
有什么建议吗?
Maybe it is sufficient to just delete the C:\agent
folder after the above command error?也许在上述命令错误之后删除
C:\agent
文件夹就足够了?
I will leave formal answer, just in case.我会留下正式的答案,以防万一。
In your case, you do not have access to Azure DevOps longer and you are not able to generate or re-generate PAT token.在您的情况下,您无法更长时间地访问 Azure DevOps,并且您无法生成或重新生成 PAT 令牌。 No problem, it is not big issue, the agent software is a connection between your (a) Server and (b) Azure DevOps.
没问题,这不是什么大问题,代理软件是您的 (a) 服务器和 (b) Azure DevOps 之间的连接。 So if you do not have access to Azure DevOps, you can not do any thing about it.
因此,如果您无权访问 Azure DevOps,您将无能为力。 What you need to focus on, is uninstalling the agent software from (a) Server so it is no longer connected to (b) Azure DevOps.
您需要关注的是从 (a) 服务器卸载代理软件,使其不再连接到 (b) Azure DevOps。
Normally to remove agent, just use .\config remove
as you already have done in our question, and ignore server errors, the only reason server requires PAT again, is to allow removing the agent from Azure DevOps remotely, hence you do not have access Azure DevOps longer, just ignore the messages, it will removing the files.通常要删除代理,只需使用
.\config remove
就像您在我们的问题中所做的那样,并忽略服务器错误,服务器再次需要 PAT 的唯一原因是允许远程从 Azure DevOps 中删除代理,因此您无权访问Azure DevOps 更长,只需忽略消息,它将删除文件。 Delete the folder and that is it.删除文件夹,就是这样。
In case you get troubling or fail removing files using .\config remove
, than you have to do manual removal.如果您使用
.\config remove
删除文件时遇到麻烦或失败,则必须手动删除。 You have 2 options below:您有以下 2 个选项:
sc delete [service name]
.sc delete [service name]
。 When one of the options is done.当其中一个选项完成时。 delete your agent folder.
删除您的代理文件夹。 Now your Server is not longer connected to Azure DevOps.
现在您的服务器不再连接到 Azure DevOps。 And you can use it for another Azure DevOps agent installation.
您可以将其用于另一个 Azure DevOps 代理安装。
Reference:参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.