Search code examples
azureazure-web-app-serviceazure-resource-managerazure-git-deployment

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


This example shows how to create a Web App that is linked to a GitHub repo via Azure Resource Manager (ARM) template: https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy

Here's the snippet of the dependent resource:

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

However, I want to create a website where I deploy from my own, local git repo. How can this be done with an ARM template?

UPDATE: To clarify what I am looking to do: I want to create a Web App that has an attached Git repo. See this article: https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/ -- The step I am trying to automate is described in the section headed "Enable the web app repository" -- I don't want to have to do it through the Azure portal


Solution

  • I was able to find the right settings for the ARM template JSON by browsing: https://resources.azure.com

    Here is the snippet...

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

    The solve was to add "scmType" key with value of "LocalGit".