Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.61 KB | None | 0 0
  1. {
  2.   "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  3.   "contentVersion": "1.0.0.0",
  4.   "parameters": {
  5.     "currentServiceplanId": {
  6.       "type": "string",
  7.       "defaultValue": "",
  8.       "metadata": {
  9.         "description": "Optional. Use an existing serviceplan for deployment"
  10.       }
  11.     },
  12.     "serviceplanSkuName": {
  13.       "type": "string",
  14.       "defaultValue": "B1",
  15.       "allowedValues": [
  16.         "B1",
  17.         "B2",
  18.         "B3",
  19.         "S1",
  20.         "S2",
  21.         "S3",
  22.         "P1",
  23.         "P2",
  24.         "P3",
  25.         "P4"
  26.       ],
  27.       "metadata": {
  28.         "description": "Describes plan's pricing tier and capacity. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
  29.       }
  30.     }
  31.   },
  32.   "variables": {
  33.     "prefix": "[replace(resourceGroup().name,'-rg','-')]",
  34.     "prefixShort": "[replace(variables('prefix'),'-', '')]",
  35.     "serviceplanName": "[concat(variables('prefix'), 'serviceplan')]",
  36.     "serviceplanId": "[variables('serviceplanIdSelector')[string(equals(length(parameters('currentServiceplanId')), 0))]]",
  37.     "serviceplanIdSelector": {
  38.       "true": "[resourceId('Microsoft.Web/serverfarms', variables('serviceplanName'))]",
  39.       "false": "[parameters('currentServiceplanId')]"
  40.     },
  41.     "api-appName": "[concat(variables('prefix'), 'api-app')]"
  42.   },
  43.   "resources": [
  44.     {
  45.       "name": "[variables('serviceplanName')]",
  46.       "condition": "[equals(length(parameters('currentServiceplanId')), 0)]",
  47.       "type": "Microsoft.Web/serverfarms",
  48.       "location": "[resourceGroup().location]",
  49.       "apiVersion": "2015-08-01",
  50.       "sku": {
  51.         "name": "[parameters('serviceplanSkuName')]"
  52.       },
  53.       "tags": {
  54.         "displayName": "serviceplan"
  55.       },
  56.       "properties": {
  57.         "name": "[variables('serviceplanName')]",
  58.         "numberOfWorkers": 1
  59.       }
  60.     },
  61.     {
  62.       "name": "[variables('api-appName')]",
  63.       "type": "Microsoft.Web/sites",
  64.       "location": "[resourceGroup().location]",
  65.       "apiVersion": "2015-08-01",
  66.       "tags": {
  67.         "[concat('hidden-related:', variables('serviceplanId'))]": "Resource",
  68.         "displayName": "api-app"
  69.       },
  70.       "properties": {
  71.         "name": "[variables('api-appName')]",
  72.         "serverFarmId": "[variables('serviceplanId')]"
  73.       }
  74.     }
  75.   ],
  76.   "outputs": {
  77.     "ApiDefaultHostname": {
  78.       "value": "[reference(variables('api-appName')).defaultHostName]",
  79.       "type": "string"
  80.     },
  81.     "ApiAppName": {
  82.       "value": "[variables('api-appName')]",
  83.       "type": "string"
  84.     }
  85.   }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement