azure - 在 Azure 应用服务中授权 GitHub Enterprise 部署过程

标签 azure github github-enterprise

在我目前的公司中,我们使用 GitHub Enterprise 作为修订控制。我使用 SAML 登录以访问我的帐户。现在我想将 GitHub 中的代码部署到我的 Azure 应用服务。所以在azure部署选项中,我选择了GitHub选项。但它说“Azure需要您的权限才能访问您的GitHub帐户”并要求我登录GitHub。但我没有 GitHub 用户名和密码,因为我们使用 SAML 访问 GitHub 帐户。您能帮我看看如何使用 Azure 授权 GitHub 帐户吗?

Azure GitHub deployment process

最佳答案

Azure 部署过程有点棘手,尝试从 Github Enterprise 进行部署,我设法让它像这样工作:

  1. In the Azure project menu, click on Properties then for the DEPLOYMENT TRIGGER URL, copy it.

  2. Go to the project settings in Github Enterprise, on the option Hooks & Services and add a new webhook, set the DEPLOYMENT TRIGGER URL on the Payload URL, leave everything else the same.

  3. Now we add the deployment process, in the Azure project menu click on Deployment Options then choose as source External Repository

  4. On your Github Account go to settings, then on the menu click on Personal Access Tokens, now generate a new token and give it the following scopes: repo and admin:pre_receive_hook then copy the token

  5. Finally, set the main branch that will activate the webhook when you push code on the repo, on the repository URL we have to set the following items:

https://<github_access_token>:x-oauth-basic@github.<enterprise>.net/<repo_name_from_root>

像这样:

https://c4207e6aae44ce086595c9abfcccb5123caf20cc:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afd782c0cedadbc782cdcedcc6ccefc8c6dbc7dacd81c2d6ccc0c2dfcec1d681c1cadb" rel="noreferrer noopener nofollow">[email protected]</a>/repolocation/deployrepo

现在推送您的存储库,Webhook 将自动触发部署和构建过程。

关于azure - 在 Azure 应用服务中授权 GitHub Enterprise 部署过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44307289/

相关文章:

azure - 在移动应用程序上注册期间绕过 Azure AD B2C 中的电子邮件验证

Azure存储表/事务和重复值

Azure ApplicationGateWay requestRoutingRules 在已定义时不会被引用

git - 查找进行 git 提交的第一个分支

github - Jekyll 与 GitHub Enterprise

git - 如何修复 git 证书错误?

azure - 公开 vnet 内的 Azure 容器实例的正确方法是什么?

github 链接到 README 中的 wiki 页面

git - 使用 GitHub 个人 SSH key 不适用于组织 repo

github-actions - fork 到我的组织后查找 github 操作时出错