Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- "currentServiceplanId": {
- "type": "string",
- "defaultValue": "",
- "metadata": {
- "description": "Optional. Use an existing serviceplan for deployment"
- }
- },
- "serviceplanSkuName": {
- "type": "string",
- "defaultValue": "B1",
- "allowedValues": [
- "B1",
- "B2",
- "B3",
- "S1",
- "S2",
- "S3",
- "P1",
- "P2",
- "P3",
- "P4"
- ],
- "metadata": {
- "description": "Describes plan's pricing tier and capacity. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
- }
- }
- },
- "variables": {
- "prefix": "[replace(resourceGroup().name,'-rg','-')]",
- "prefixShort": "[replace(variables('prefix'),'-', '')]",
- "serviceplanName": "[concat(variables('prefix'), 'serviceplan')]",
- "serviceplanId": "[variables('serviceplanIdSelector')[string(equals(length(parameters('currentServiceplanId')), 0))]]",
- "serviceplanIdSelector": {
- "true": "[resourceId('Microsoft.Web/serverfarms', variables('serviceplanName'))]",
- "false": "[parameters('currentServiceplanId')]"
- },
- "api-appName": "[concat(variables('prefix'), 'api-app')]"
- },
- "resources": [
- {
- "name": "[variables('serviceplanName')]",
- "condition": "[equals(length(parameters('currentServiceplanId')), 0)]",
- "type": "Microsoft.Web/serverfarms",
- "location": "[resourceGroup().location]",
- "apiVersion": "2015-08-01",
- "sku": {
- "name": "[parameters('serviceplanSkuName')]"
- },
- "tags": {
- "displayName": "serviceplan"
- },
- "properties": {
- "name": "[variables('serviceplanName')]",
- "numberOfWorkers": 1
- }
- },
- {
- "name": "[variables('api-appName')]",
- "type": "Microsoft.Web/sites",
- "location": "[resourceGroup().location]",
- "apiVersion": "2015-08-01",
- "tags": {
- "[concat('hidden-related:', variables('serviceplanId'))]": "Resource",
- "displayName": "api-app"
- },
- "properties": {
- "name": "[variables('api-appName')]",
- "serverFarmId": "[variables('serviceplanId')]"
- }
- }
- ],
- "outputs": {
- "ApiDefaultHostname": {
- "value": "[reference(variables('api-appName')).defaultHostName]",
- "type": "string"
- },
- "ApiAppName": {
- "value": "[variables('api-appName')]",
- "type": "string"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement