如何知道 github 存储库链接到用于持续部署的 Azure 函数

How to know github repository linked to azure function for continuous deployment

我已按照此 documentation 为 Azure Functions 设置持续部署。现在我已经成功地在 Azure 函数中设置 github 存储库以进行持续部署。

因为我有多个 Azure 函数,每个函数与不同的 github 分支相关联。现在我想知道哪个 Github 存储库和分支 link 具有特定的 Azure 功能

我怎样才能得到这些信息?

更新 1:-

我需要 link 不同的 git-hub 分支用于不同的功能应用程序。

当我配置持续部署后转到部署选项时。然后我看到推送到相应分支的提交列表。但我想知道哪个存储库 + 分支 linked 到特定的功能应用程序。我在哪里可以看到该信息?

如果您想知道哪个分支用于部署,您可以使用 Kudu 环境。

前往https://[yourUrl].scm.azurewebsites.net/

从这里您可以访问 REST API。 Settings 端点包含您需要的信息。 https://[yourUrl].scm.azurewebsites.net/api/settings

通过导航到此端点,您将收到一些 JSON,其中名为 deployment_branch 的字段填充了您用于部署的分支

{
    "deployment_branch": "master",
    // Other stuff        
}

要检查存储库,如果您已经在 Kudu 门户中,您可以尝试以下操作:

D:\home\site\repository>git remote -v

感觉有点老套,但这是一种检索存储库遥控器(来源)的方法。 不过,我不建议这样做。正在寻找更好的方法,但目前仅此而已。

这可能是唯一的方法,正如文档所述following:

App Service creates an association with the selected repository, pulls in the files from the specified branch, and maintains a clone of your repository for your App Service app. When you configure VSTS continuous deployment from the Azure portal, the integration uses the App Service Kudu deployment engine, which already automates build and deployment tasks with every git push. You do not need to separately set up continuous deployment in VSTS. After this process completes, the Deployment options app blade will show an active deployment that indicates deployment has succeeded.

不过,如果您需要这种粒度,请考虑 @David Ebbo 的评论并为不同的功能使用多个存储库。

据我了解,您可以使用kudu查看D:\home\site\repository文件夹,在.git文件夹下找到config文件,然后您可以检索端点您配置的存储库如下:

此外,对于您选择的分支,您可以查看 D:\home\site\deployments 路径下的 settings.xml 文件。