June 18, 2017

/

Adding a Site Extension to an Azure Web App in an ARM template deployment

Adding a Site Extension to an Azure Web App in an ARM template deployment

Azure ARM templates let you deploy and configure various Azure resources using a JSON file with a particular schema. Most of this schema is pretty easy to figure out from their documentation or by creating the resources in the Azure Portal and then using the “Automated Script” section of the resource group to look at what and how things were deployed.

One thing I haven’t found great documentation on are Azure Web App Site Extentions. For example if I wanted to install the Composer Extension automatically when I deployed my web app. Here is what you need to know.

The ARM Template JSON

You need to add a resource to the resource section of your Azure Web App that has the site extension name. Just to make it clear in your ARM template you have a top level resources array and then within your Web App you can have another resources array. It is the array within the target web app you should add the following:

{
    "apiVersion": "2015-08-01",
    "name": "name-of-extension",
    "type": "siteextensions",
    "dependsOn": [
        "the-name-of-your-webapp"
    ]
}

You need to replace the-name-of-your-webapp and name-of-extension with the appropriate values.

But how do I know the name-of-extension value? You look up the extension on the Site Extension Gallery and take the value that is in the URL on its home page. For example the Composer extension has the URL:

https://www.siteextensions.net/packages/ComposerExtension/

So the name is “ComposerExtension”. An example of a web app with the composer:

Tags:

Seth Reid

/

Adding a Site Extension to an Azure Web App in an ARM template deployment