Install Azure Site Extensions with ARM template

04/08/2015

Azure Site Extensions is a way to add extra functionality to an azure web app. Currently the number of extensions are rather limited, but yet there are a few interesting ones, e.g. the Visual Studio Online extensions that lets you edit your code directly in the Azure Web Site.

If you want to develop your own extensions that is also fairly easy (although it might be hard to come up with a good idea, as azure web apps already are able to do so many things). Regardless if you are interested in developing your own head over to the Kudu Github Repo and take a look at this article.

Extensions are essentially a nuget package that contains an applicationhost.xdt file, that explains how to install the extensions. Extensions are typically a small web application that is mapped into the Kudu site, via a virtual directory pointing to the location where the extension is installed. By default (and I don’t think it is possible to change it) extensions are installed in d:\Program Files (x86)\SiteExtensions\
Here’s a dir in that folder to give you an idea of what is Microsoft puts on your server without you even asking for it.

D:\Program Files (x86)\SiteExtensions>dir
Volume in drive D is Windows
Volume Serial Number is C83A-45BE

Directory of D:\Program Files (x86)\SiteExtensions

06/30/2015 10:34 PM

.
06/30/2015 10:34 PM
..
07/31/2015 08:01 PM
ApiAppsGateway
07/21/2015 01:36 AM
AppIdentify
06/23/2015 12:11 AM
AzureJobs
05/30/2015 10:32 AM
DaaS
05/30/2015 10:13 AM
DebugSiteExtension
06/30/2015 10:34 PM
dropboxconnector
05/30/2015 10:32 AM EMABench
06/30/2015 10:34 PM FacebookConnector
05/30/2015 10:13 AM httpPlatformHandler
05/30/2015 10:20 AM iisnodedebugger
05/30/2015 10:12 AM InetMgr
07/31/2015 08:01 PM Kudu
05/30/2015 10:31 AM Microsoft.Azure.AppService.ApiApps.TestBench
05/30/2015 10:31 AM Migrate
06/24/2015 10:37 PM MobileServicesDotNet
05/30/2015 10:31 AM MobileServicesNode
07/31/2015 08:01 PM Monaco
05/30/2015 10:31 AM MSDeploy
06/30/2015 10:34 PM SalesforceConnector
05/30/2015 10:28 AM SecurityInsightAdmin
05/30/2015 10:28 AM Tinfoil
06/30/2015 10:34 PM TwitterConnector
06/30/2015 10:34 PM YammerConnector
07/29/2015 04:58 PM Zray54
07/29/2015 04:59 PM Zray55
07/29/2015 04:59 PM Zray56

All the public extensions from the extension gallery is hosted at http://www.siteextensions.net/. If you make your own site extension you can also get it hosted there as it is just a nuget feed. If you don’t want to share your extension with the world, you can also host it on a private nuget feed.

A few of the extensions are preinstalled on the server like e.g. the Monaco (Visual Studio Online) Extension, so it doesn’t show up in the feed at http://www.siteextensions.net/.

Anyways, enough about how site extensions works, what I really wanted to show with this post, was how to install them from an Azure Resource Manager (ARM) template. Behold here goes:

Here’s how the Microsoft.Web/sites resource template looks like, that installs the Monaco extension (Visual Studio Online).
[javascript]
{
"apiVersion": "2014-04-01",
"name": "[parameters(‘siteName’)]",
"type": "Microsoft.Web/sites",
"location": "[parameters(‘siteLocation’)]",
"dependsOn": [
"[resourceId(‘Microsoft.Web/serverfarms’, parameters(‘hostingPlanName’))]",
],
"properties": {
"name": "[parameters(‘siteName’)]",
"webHostingPlan": "[parameters(‘hostingPlanName’)]"
},
"resources": [
{
"apiVersion": "2014-04-01",
"name": "web",
"type": "config",
"dependsOn": [
"[resourceId(‘Microsoft.Web/Sites’, parameters(‘siteName’))]"
],
"properties": {
"appSettings": [
{ "Name": "SCM_SITEEXTENSIONS_FEED_URL", "Value": "http://www.siteextensions.net/api/v2/" },
]
}
},
{
"apiVersion": "2014-04-01",
"name": "Monaco",
"type": "siteextensions",
"dependsOn": [
"[resourceId(‘Microsoft.Web/Sites’, parameters(‘siteName’))]",
"[resourceId(‘Microsoft.Web/Sites/config’, parameters(‘siteName’), ‘web’)]"
],
"properties": { }
},
]
}
[/javascript]
As you can see we specify a SCM_SITEEXTENSIONS_FEED_URL app setting, that points to the nuget feed. This is strictly not neccessary as Kudu per default uses that feed, but if you want to deploy an extension from your own feed this would be the place to put your feed url.