Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 539
dprothero Avatar asked Feb 24 '16 16:02

dprothero


People also ask

How do you deploy webapp using ARM template?

Deploying the ARM Template in Visual Studio To deploy the ARM template, within Visual Studio, right click on the project name. In the screenshot below, the project name is webapp. Choose Deploy —> New to deploy the Azure Web App to Azure. You will be presented with the Deploy to Resource Group screen.


1 Answers

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".

like image 132
dprothero Avatar answered Oct 06 '22 08:10

dprothero