Skip to content

Instantly share code, notes, and snippets.

@Geertvdc
Created November 5, 2016 22:59
Show Gist options
  • Save Geertvdc/563bf918e990854f3f25c2b93c2afb74 to your computer and use it in GitHub Desktop.
Save Geertvdc/563bf918e990854f3f25c2b93c2afb74 to your computer and use it in GitHub Desktop.
Deploy Web app + App service plan to Application Service Environment in other subscription in enterprise agreement
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"TmpAppPlanInASEName": {
"type": "string",
"minLength": 1
},
"appServiceEnvironmentName": {
"type": "string",
"minLength": 1
},
"location": {
"type": "string",
"minLength": 1
},
"workerPool": {
"type": "string",
"minLength": 1
},
"numberOfWorkersFromWorkerPool": {
"type": "string",
"minLength": 1
}
},
"variables": {
"WebAppInTmpASEName": "[concat('WebAppInTmpASE', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"name": "[parameters('TmpAppPlanInASEName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('location')]",
"apiVersion": "2015-08-01",
"dependsOn": [],
"tags": {
"displayName": "TmpAppPlanInASE"
},
"properties": {
"name": "[parameters('TmpAppPlanInASEName')]",
"hostingEnvironmentProfile": {
"id": "[parameters('appServiceEnvironmentName')]"
}
},
"sku": {
"name": "[concat('P',parameters('workerPool'))]",
"tier": "Premium",
"size": "[concat('P',parameters('workerPool'))]",
"family": "P",
"capacity": "[parameters('numberOfWorkersFromWorkerPool')]"
}
},
{
"name": "[variables('WebAppInTmpASEName')]",
"type": "Microsoft.Web/sites",
//"location": "[resourceGroup().location]",
"location": "[parameters('location')]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('TmpAppPlanInASEName'))]"
],
"tags": {
"[concat('hidden-related:', resourceId('Microsoft.Web/serverfarms', parameters('TmpAppPlanInASEName')))]": "Resource",
"displayName": "WebAppInTmpASE"
},
"properties": {
"name": "[variables('WebAppInTmpASEName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('TmpAppPlanInASEName'))]",
"hostingEnvironmentProfile": {
"id": "[parameters('appServiceEnvironmentName')]"
}
}
}
],
"outputs": {
}
}
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment