简体   繁体   English

如何删除管道对自托管代理的访问(没有原始 PAT 或对 azure devops 的访问)?

[英]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.以下是设置自托管代理的步骤。

  1. Create a azure devops organization创建一个 azure devops 组织
  2. Create personal access token (PAT) with manage agent permissions创建具有管理代理权限的个人访问令牌 (PAT)
  3. Create an agent in azure devops在 azure devops 中创建代理
  4. On the target machine download the zip, unzip, run ./config.cmd在目标机器上下载 zip,解压缩,运行./config.cmd
  5. Enter url, PAT输入网址,PAT

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 个选项:

  • If you have installed the agent as Service.如果您已将代理安装为服务。 Stop the service and deleting agent service in local system through: sc delete [service name] .通过以下方式停止服务并删除本地系统中的代理服务: sc delete [service name]
  • If it is just running in command line.如果它只是在命令行中运行。 Stop the command line.停止命令行。

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.

相关问题 如何在自托管的 Windows 代理中安装 Liquibase? (Azure Devops 管道) - How to install Liquibase in a self hosted Windows agent ? (Azure Devops Pipeline) Azure 用于 Java 项目的 DevOps 管道,带有自托管代理 - Azure DevOps Pipeline for Java Project with self hosted agent 如何在自托管 Windows 代理上从 Azure DevOps 管道运行 Azure CLI 任务? - How to run Azure CLI tasks from an Azure DevOps Pipeline on a Self-Hosted Windows Agent? 从自托管的 Azure DevOps 代理访问存储在 AzureML 工作区中的 ML 模型 - Access ML-model stored in AzureML Workspace from self-hosted Azure DevOps agent 使用自托管代理的 DevOps 中的 Bud Pipeline 问题 - Issue with Buld Pipeline in DevOps with Self Hosted Agent 自托管 MacOS 代理上的 DevOps 管道在 NuGet package 恢复但适用于 Azure 管道上失败 - DevOps pipeline on self-hosted MacOS agent fails on NuGet package restore but works on Azure Pipeline Azure Devops 管道,知道管道何时完成的方法,使用自托管代理 - Azure Devops pipeline , way to know when pipeline is done , using self hosted agent 托管代理失败的 Azure DevOps 构建管道 - Azure DevOps build pipeline with hosted agent failing 如何从 devOps 管道访问 azure 门户的配置? - How to access azure portal’s configuration from devOps pipeline? 自托管 Azure DevOps 管道代理失败并出现错误令牌受众无效 - Self Hosted Azure DevOps Pipeline Agent fails with error Token Audience is not valid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM