git - 无法使用服务主体从发布管道访问 Azure Devops Git 存储库

标签 git azure azure-devops terraform

我们正在为 Azure 资源创建 Terraform 模块;我们在项目中为每个模块提供了自己的存储库,但是当尝试在发布管道中调用该模块时,我们会遇到超时或错误 128。

这在管道外部作为具有部署权限的用户运行,但是我们使用服务主体在发布管道内进行部署,该管道也具有正确的权限;问题似乎在于服务主体在 Azure DevOps 中没有任何权利。

我们最初尝试使用托管构建代理,但如果我们需要存储任何永久信息,则刚刚部署了我们自己的私有(private)代理。

模块“rg”{ 源 =“git::https://dev.azure.com/ *****/Terraform/_git/azmodresourcegroup//module?ref=v1.0” }

这看起来像是一个权利问题,但有人能给我指出解决方法吗?

错误是: C:\Program Files\Git\bin\git.exe 退出并显示 128: 克隆到 '.terraform\modules\

或长时间(30 分钟)超时。

最佳答案

只是为了详细说明一下,引用托管在私有(private) AzureDevOps 存储库中的 terraform 模块/使用个人访问 token 进行身份验证。

module "example_module" {
    source = "git::https://INSERT_ORG_NAME:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7d34332e382f292229323638333d19180b531c07080f18531e1210" rel="noreferrer noopener nofollow">[email protected]</a>/INSERT_ORG_NAME/terraform_module/_git/terraform_module?ref=INSERT_TAG"
}

关于git - 无法使用服务主体从发布管道访问 Azure Devops Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56993583/

相关文章:

c# - Azure DevOps Pipeline - dotnet restore 包内容哈希验证失败

Git merge master 到分支并接受部分更改

linux - 无法在 bash 中获得正确的 git 分支名称

java - 从 microsoft azure mysql 恢复 mysql 数据

azure - 无法从 Azure Active Directory 将用户添加到 VSTS

build - Visual Studio Team Services 如何管理自定义或内部依赖项?

git - 将团队从 Git Merge 切换到 Rebase

git - 授予对 github 上单个文件的访问权限

sql-server - 如何衡量Azure SQL DB的性能?

azure - Blazor HttpClient GetAsync 由于删除而 super 慢