使用资源管理器 (ARM) 模板部署 Git 部署 Azure Web 应用程序

Deploy Azure Web App with Git deployment using Resource Manager (ARM) Template

此示例展示了如何通过 Azure 资源管理器 (ARM) 模板创建链接到 GitHub 存储库的 Web 应用程序:https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy

这是依赖资源的片段:

    {
      "apiVersion": "2015-04-01",
      "name": "web",
      "type": "sourcecontrols",
      "dependsOn": [
        "[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
      ],
      "properties": {
        "RepoUrl": "[parameters('repoURL')]",
        "branch": "[parameters('branch')]",
        "IsManualIntegration": true
      }
    }

但是,我想创建一个网站,在其中部署我自己的本地 git 存储库。如何使用 ARM 模板完成此操作?

更新: 阐明我想要做什么:我想创建一个带有附加 Git 存储库的 Web 应用程序。请参阅这篇文章:https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/ -- 我尝试 自动化 的步骤在标题为 "Enable the web app repository" 的部分中进行了描述 -- 我不想必须这样做通过 Azure 门户

Git 存储库本身除了保存您的代码和脚本的版本之外没有做任何事情。

但是,如果您将其连接到构建系统,例如 Visual Studio Team Services (free = nice!) you can have the build system both compile your website, and then execute your ARM template, through release management 以提供 clean/fresh 环境。

我能够通过浏览找到 ARM 模板 JSON 的正确设置:https://resources.azure.com

这是片段...

  "resources": [
    {
      "apiVersion": "2015-08-01",
      "name": "web",
      "type": "config",
      "dependsOn": [
        "[resourceId('Microsoft.Web/Sites/', variables('siteName'))]"
      ],
      "properties": {
        "phpVersion": " ",
        "scmType":  "LocalGit"
      }
    }
  ]

解决方法是添加值为 "LocalGit" 的 "scmType" 键。