在 Azure 应用服务中授权 GitHub 企业部署过程

Authorize GitHub Enterprise deployment process in Azure App service

在我目前的公司中,我们使用 GitHub Enterprise 作为修订控制。我使用 SAML 登录以访问我的帐户的位置。现在我想将 GitHub 中的代码部署到我的 Azure 应用程序服务。所以在 azure 部署选项中,我选择了 GitHub 选项。但它说 "Azure needs your permission to access your GitHub account" 并要求我登录 GitHub。但是我没有 GitHub 用户名和密码,因为我们正在使用 SAML 访问 GitHub 帐户。您能帮我如何授权 GitHub Azure 帐户吗?

Azure GitHub deployment process

A​​zure 部署过程有点棘手,尝试从 Github 企业部署,我设法让它像这样工作:

  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:x-oauth-basic@github.mycompany.net/repolocation/deployrepo

现在推送你的 repo,webhook 将自动触发部署和构建过程。