Infrastructure as Code is a DevOps practice that you can enable using Azure Resource Manager templates with Visual Studio Team Services.
There is a great resource on GitHub of quick start ARM templates. However, I could not find one that showed me how to use ARM to provision a Web app with Java 8 and Tomcat 8 enabled. So, in this post I will show how using Visual Studio 2015 with Azure SDK 2.8. To reduce any confusion, I am going to delete all optional resources.
We are going to begin by creating a new project in Visual Studio.
- Start Visual Studio
- From the File menu, select New > Project…
- Select Azure Resource Group
- Click OK
- Select Web app
- Click OK
- From Solution Explorer, select WebSite.json
- From the JSON Outline, delete the following resources:
- AutoScaleSettings
- ServerErrorsAlertRule
- ForbiddenRequestsAlertRule
- CPUHighAlertRule
- LongHttpQueueAlertRule
- AppInsightsComponent
- Copy and paste the code below into WebSite.json under the Website properties
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "config",
"dependsOn": [ "[concat('Microsoft.Web/sites/', variables('webSiteName'))]" ],
"properties": {
"javaVersion": "1.8",
"javaContainer": "TOMCAT",
"javaContainerVersion": "8.0"
}
}
]
- From Solution Explorer, right-click your project
- Select Deploy > New Deployment…
- Select or create a new Resource group
- Click Edit Parameters…
Field Name
|
Value
|
hostingPlanName |
javahostingplan |
skuName |
F1 |
skuCapacity |
1 |
- Click Save
- Click Deploy
- You can monitor the status of your deployment from the Output window
- Once complete, you will have a new Java enabled Web app

Visual Studio Team Services enables the use of this template in your DevOps pipeline via the Azure Resource Group Deployment task.
