Bitbucket与Azure DevOps之间的集成 [英] Integration between Bitbucket and Azure DevOps

查看:60
本文介绍了Bitbucket与Azure DevOps之间的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是我想将我的Bitbucket存储库与Azure DevOps CI服务器集成在一起,以便一旦我在Bitbucket存储库中推送代码,我的管道就应该在Azure DevOps CI服务器中触发,因为我已经在其中创建了一个Webhook.Bitbucket回购.

My requirement is I want to integrate my Bitbucket repo with the Azure DevOps CI server so that as soon as I push code in the bitbucket repo my pipeline should trigger in the Azure DevOps CI server for that I have created a webhook in the Bitbucket repo.

我在"URL"部分中添加了Azure DevOps CI服务器URL,并在Bitbucket的webhook的秘密"部分中添加了secret.秘密是在Azure DevOps Server中生成的个人访问令牌.但是在创建网络挂钩时,​​我得到了

I have added the Azure DevOps CI server URL in the URL section and added secret in a secret section of the webhook of Bitbucket. the secret is personal access token generated in Azure DevOps Server. But while creating a webhook I am getting

Resource not available for anonymous access. Client authentication required. - Azure DevOps server

即使我添加了一个秘密,为什么它也会给出客户端身份验证所需的错误?可能是什么原因?

Even though I have added a secret why it is giving client authentication required error? what could be the reason?

P.S.-Bitbucket存储库和Azure DevOps CI服务器之间集成的文档很稀缺

P.S. - There is a scarcity of documentation for integration between Bitbucket repo and Azure DevOps CI server

更新:我已经按照答案中Vito Liu-MSFT的建议在触发器选项卡上启用了持续集成,但是当我将代码推送至功能部件/POC时,管道仍未自动触发在bitbucket中分支.

Update : I have already enabled continuous integration on the triggers tab as suggested by Vito Liu-MSFT in the answer but still my pipeline is not getting triggered automatically when I push my code to feature/POC branch in bitbucket.

Yml文件如下

resources:
  repositories:
  - repository: myRepo
    type: externalgit
    name: 'myRepo' 
    endpoint: myrepo
    ref: feature/POC 

trigger:
  - feature/POC

推荐答案

我终于通过替换{}花括号中的值,从URL下方创建了webhook.现在我在webhook中收到200条回复

I have finally created webhook from below URL by replacing values in {} braces. Now i got 200 response in webhook

       https://{hostName}/{collectionName}/_apis/public/pipelines/webhooks/{projectName}/{buildDefinitionId}/{repositoryKey}?api-version=6.0-preview.1 

这篇关于Bitbucket与Azure DevOps之间的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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