6

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

2 Answers 2

7

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

Sign up to request clarification or add additional context in comments.

3 Comments

THANK you. How on earth are we supposed to guess this? I have spent hours trying to put the right parameters to the "sourcecontrols" section
Can you provide the full snippet?
@ErikA.Brandstadmoen Full docs can be found here learn.microsoft.com/en-us/azure/templates/microsoft.web/…
0

A Git repo does not, in itself do anything other than to just save versions of your code and scripts.

However, if you hook this up to a build system, such as 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 in order to provision a clean/fresh environment.

1 Comment

That's not what I was asking. I want to create a Web App that has an attached Git repo. See this article: azure.microsoft.com/en-us/documentation/articles/… -- 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.