You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

589 lines
26 KiB

  1. {
  2. "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
  3. "contentVersion": "1.0.0.0",
  4. "parameters": {
  5. "clusterLocation": {
  6. "type": "string",
  7. "metadata": {
  8. "description": "Location of the Cluster"
  9. }
  10. },
  11. "clusterName": {
  12. "type": "string",
  13. "defaultValue": "Cluster",
  14. "metadata": {
  15. "description": "Name of your cluster - Between 3 and 23 characters. Letters and numbers only"
  16. }
  17. },
  18. "nt0applicationStartPort": {
  19. "type": "int",
  20. "defaultValue": 20000
  21. },
  22. "nt0applicationEndPort": {
  23. "type": "int",
  24. "defaultValue": 30000
  25. },
  26. "nt0ephemeralStartPort": {
  27. "type": "int",
  28. "defaultValue": 49152
  29. },
  30. "nt0ephemeralEndPort": {
  31. "type": "int",
  32. "defaultValue": 65534
  33. },
  34. "nt0fabricTcpGatewayPort": {
  35. "type": "int",
  36. "defaultValue": 19000
  37. },
  38. "nt0fabricHttpGatewayPort": {
  39. "type": "int",
  40. "defaultValue": 19080
  41. },
  42. "nt0reverseProxyEndpointPort": {
  43. "type": "int",
  44. "defaultValue": 19081
  45. },
  46. "subnet0Name": {
  47. "type": "string",
  48. "defaultValue": "Subnet-0"
  49. },
  50. "subnet0Prefix": {
  51. "type": "string",
  52. "defaultValue": "10.0.0.0/24"
  53. },
  54. "computeLocation": {
  55. "type": "string"
  56. },
  57. "publicIPAddressName": {
  58. "type": "string",
  59. "defaultValue": "PublicIP-VM"
  60. },
  61. "publicIPAddressType": {
  62. "type": "string",
  63. "allowedValues": [
  64. "Dynamic"
  65. ],
  66. "defaultValue": "Dynamic"
  67. },
  68. "vmStorageAccountContainerName": {
  69. "type": "string",
  70. "defaultValue": "vhds"
  71. },
  72. "adminUserName": {
  73. "type": "string",
  74. "defaultValue": "testadm",
  75. "metadata": {
  76. "description": "Remote desktop user Id"
  77. }
  78. },
  79. "adminPassword": {
  80. "type": "securestring",
  81. "metadata": {
  82. "description": "Remote desktop user password. Must be a strong password"
  83. }
  84. },
  85. "virtualNetworkName": {
  86. "type": "string",
  87. "defaultValue": "VNet"
  88. },
  89. "addressPrefix": {
  90. "type": "string",
  91. "defaultValue": "10.0.0.0/16"
  92. },
  93. "dnsName": {
  94. "type": "string"
  95. },
  96. "nicName": {
  97. "type": "string",
  98. "defaultValue": "NIC"
  99. },
  100. "lbName": {
  101. "type": "string",
  102. "defaultValue": "LoadBalancer"
  103. },
  104. "lbIPName": {
  105. "type": "string",
  106. "defaultValue": "PublicIP-LB-FE"
  107. },
  108. "overProvision": {
  109. "type": "string",
  110. "defaultValue": "false"
  111. },
  112. "vmImagePublisher": {
  113. "type": "string",
  114. "defaultValue": "MicrosoftWindowsServer"
  115. },
  116. "vmImageOffer": {
  117. "type": "string",
  118. "defaultValue": "WindowsServer"
  119. },
  120. "vmImageSku": {
  121. "type": "string",
  122. "defaultValue": "2012-R2-Datacenter"
  123. },
  124. "vmImageVersion": {
  125. "type": "string",
  126. "defaultValue": "latest"
  127. },
  128. "storageAccountType": {
  129. "type": "string",
  130. "allowedValues": [
  131. "Standard_LRS",
  132. "Standard_GRS"
  133. ],
  134. "defaultValue": "Standard_LRS",
  135. "metadata": {
  136. "description": "Replication option for the VM image storage account"
  137. }
  138. },
  139. "supportLogStorageAccountType": {
  140. "type": "string",
  141. "allowedValues": [
  142. "Standard_LRS",
  143. "Standard_GRS"
  144. ],
  145. "defaultValue": "Standard_LRS",
  146. "metadata": {
  147. "description": "Replication option for the support log storage account"
  148. }
  149. },
  150. "supportLogStorageAccountName": {
  151. "type": "string",
  152. "defaultValue": "[toLower( concat('sflogs', uniqueString(resourceGroup().id),'2'))]",
  153. "metadata": {
  154. "description": "Name for the storage account that contains support logs from the cluster"
  155. }
  156. },
  157. "nt0InstanceCount": {
  158. "type": "int",
  159. "defaultValue": 1,
  160. "metadata": {
  161. "description": "Instance count for node type"
  162. }
  163. },
  164. "vmNodeType0Name": {
  165. "type": "string",
  166. "defaultValue": "primary",
  167. "maxLength": 9
  168. },
  169. "vmNodeType0Size": {
  170. "type": "string",
  171. "defaultValue": "Standard_D1_v2"
  172. },
  173. "SFReverseProxyPort": {
  174. "type": "int",
  175. "defaultValue": 19081,
  176. "metadata": {
  177. "description": "Endpoint for Service Fabric Reverse proxy"
  178. }
  179. }
  180. },
  181. "variables": {
  182. "vmssApiVersion": "2017-03-30",
  183. "lbApiVersion": "2015-06-15",
  184. "vNetApiVersion": "2015-06-15",
  185. "storageApiVersion": "2016-01-01",
  186. "publicIPApiVersion": "2015-06-15",
  187. "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',parameters('virtualNetworkName'))]",
  188. "subnet0Ref": "[concat(variables('vnetID'),'/subnets/',parameters('subnet0Name'))]",
  189. "lbID0": "[resourceId('Microsoft.Network/loadBalancers', concat('LB','-', parameters('clusterName'),'-',parameters('vmNodeType0Name')))]",
  190. "lbIPConfig0": "[concat(variables('lbID0'),'/frontendIPConfigurations/LoadBalancerIPConfig')]",
  191. "lbPoolID0": "[concat(variables('lbID0'),'/backendAddressPools/LoadBalancerBEAddressPool')]",
  192. "lbProbeID0": "[concat(variables('lbID0'),'/probes/FabricGatewayProbe')]",
  193. "lbHttpProbeID0": "[concat(variables('lbID0'),'/probes/FabricHttpGatewayProbe')]",
  194. "lbNatPoolID0": "[concat(variables('lbID0'),'/inboundNatPools/LoadBalancerBEAddressNatPool')]",
  195. "vmStorageAccountName0": "[toLower(concat(uniqueString(resourceGroup().id), '1', '0' ))]",
  196. "uniqueStringArray0": [
  197. "[concat(variables('vmStorageAccountName0'), '0')]",
  198. "[concat(variables('vmStorageAccountName0'), '1')]",
  199. "[concat(variables('vmStorageAccountName0'), '2')]",
  200. "[concat(variables('vmStorageAccountName0'), '3')]",
  201. "[concat(variables('vmStorageAccountName0'), '4')]"
  202. ]
  203. },
  204. "resources": [
  205. {
  206. "apiVersion": "[variables('storageApiVersion')]",
  207. "type": "Microsoft.Storage/storageAccounts",
  208. "name": "[parameters('supportLogStorageAccountName')]",
  209. "location": "[parameters('computeLocation')]",
  210. "dependsOn": [],
  211. "properties": {},
  212. "kind": "Storage",
  213. "sku": {
  214. "name": "[parameters('supportLogStorageAccountType')]"
  215. },
  216. "tags": {
  217. "resourceType": "Service Fabric",
  218. "clusterName": "[parameters('clusterName')]"
  219. }
  220. },
  221. {
  222. "apiVersion": "[variables('vNetApiVersion')]",
  223. "type": "Microsoft.Network/virtualNetworks",
  224. "name": "[parameters('virtualNetworkName')]",
  225. "location": "[parameters('computeLocation')]",
  226. "dependsOn": [],
  227. "properties": {
  228. "addressSpace": {
  229. "addressPrefixes": [
  230. "[parameters('addressPrefix')]"
  231. ]
  232. },
  233. "subnets": [
  234. {
  235. "name": "[parameters('subnet0Name')]",
  236. "properties": {
  237. "addressPrefix": "[parameters('subnet0Prefix')]"
  238. }
  239. }
  240. ]
  241. },
  242. "tags": {
  243. "resourceType": "Service Fabric",
  244. "clusterName": "[parameters('clusterName')]"
  245. }
  246. },
  247. {
  248. "apiVersion": "[variables('publicIPApiVersion')]",
  249. "type": "Microsoft.Network/publicIPAddresses",
  250. "name": "[concat(parameters('lbIPName'),'-','0')]",
  251. "location": "[parameters('computeLocation')]",
  252. "properties": {
  253. "dnsSettings": {
  254. "domainNameLabel": "[parameters('dnsName')]"
  255. },
  256. "publicIPAllocationMethod": "Dynamic"
  257. },
  258. "tags": {
  259. "resourceType": "Service Fabric",
  260. "clusterName": "[parameters('clusterName')]"
  261. }
  262. },
  263. {
  264. "apiVersion": "[variables('lbApiVersion')]",
  265. "type": "Microsoft.Network/loadBalancers",
  266. "name": "[concat('LB','-', parameters('clusterName'),'-',parameters('vmNodeType0Name'))]",
  267. "location": "[parameters('computeLocation')]",
  268. "dependsOn": [
  269. "[concat('Microsoft.Network/publicIPAddresses/',concat(parameters('lbIPName'),'-','0'))]"
  270. ],
  271. "properties": {
  272. "frontendIPConfigurations": [
  273. {
  274. "name": "LoadBalancerIPConfig",
  275. "properties": {
  276. "publicIPAddress": {
  277. "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('lbIPName'),'-','0'))]"
  278. }
  279. }
  280. }
  281. ],
  282. "backendAddressPools": [
  283. {
  284. "name": "LoadBalancerBEAddressPool",
  285. "properties": {}
  286. }
  287. ],
  288. "loadBalancingRules": [
  289. {
  290. "name": "LBRule",
  291. "properties": {
  292. "backendAddressPool": {
  293. "id": "[variables('lbPoolID0')]"
  294. },
  295. "backendPort": "[parameters('nt0fabricTcpGatewayPort')]",
  296. "enableFloatingIP": "false",
  297. "frontendIPConfiguration": {
  298. "id": "[variables('lbIPConfig0')]"
  299. },
  300. "frontendPort": "[parameters('nt0fabricTcpGatewayPort')]",
  301. "idleTimeoutInMinutes": "5",
  302. "probe": {
  303. "id": "[variables('lbProbeID0')]"
  304. },
  305. "protocol": "tcp"
  306. }
  307. },
  308. {
  309. "name": "LBHttpRule",
  310. "properties": {
  311. "backendAddressPool": {
  312. "id": "[variables('lbPoolID0')]"
  313. },
  314. "backendPort": "[parameters('nt0fabricHttpGatewayPort')]",
  315. "enableFloatingIP": "false",
  316. "frontendIPConfiguration": {
  317. "id": "[variables('lbIPConfig0')]"
  318. },
  319. "frontendPort": "[parameters('nt0fabricHttpGatewayPort')]",
  320. "idleTimeoutInMinutes": "5",
  321. "probe": {
  322. "id": "[variables('lbHttpProbeID0')]"
  323. },
  324. "protocol": "tcp"
  325. }
  326. },
  327. {
  328. "name": "LBSFReverseProxyRule",
  329. "properties": {
  330. "backendAddressPool": {
  331. "id": "[variables('lbPoolID0')]"
  332. },
  333. "backendPort": "[parameters('SFReverseProxyPort')]",
  334. "enableFloatingIP": "false",
  335. "frontendIPConfiguration": {
  336. "id": "[variables('lbIPConfig0')]"
  337. },
  338. "frontendPort": "[parameters('SFReverseProxyPort')]",
  339. "idleTimeoutInMinutes": "5",
  340. "probe": {
  341. "id": "[concat(variables('lbID0'),'/probes/SFReverseProxyProbe')]"
  342. },
  343. "protocol": "tcp"
  344. }
  345. }
  346. ],
  347. "probes": [
  348. {
  349. "name": "FabricGatewayProbe",
  350. "properties": {
  351. "intervalInSeconds": 5,
  352. "numberOfProbes": 2,
  353. "port": "[parameters('nt0fabricTcpGatewayPort')]",
  354. "protocol": "tcp"
  355. }
  356. },
  357. {
  358. "name": "FabricHttpGatewayProbe",
  359. "properties": {
  360. "intervalInSeconds": 5,
  361. "numberOfProbes": 2,
  362. "port": "[parameters('nt0fabricHttpGatewayPort')]",
  363. "protocol": "tcp"
  364. }
  365. },
  366. {
  367. "name": "SFReverseProxyProbe",
  368. "properties": {
  369. "intervalInSeconds": 5,
  370. "numberOfProbes": 2,
  371. "port": "[parameters('SFReverseProxyPort')]",
  372. "protocol": "tcp"
  373. }
  374. }
  375. ],
  376. "inboundNatPools": [
  377. {
  378. "name": "LoadBalancerBEAddressNatPool",
  379. "properties": {
  380. "backendPort": "3389",
  381. "frontendIPConfiguration": {
  382. "id": "[variables('lbIPConfig0')]"
  383. },
  384. "frontendPortRangeEnd": "4500",
  385. "frontendPortRangeStart": "3389",
  386. "protocol": "tcp"
  387. }
  388. }
  389. ]
  390. },
  391. "tags": {
  392. "resourceType": "Service Fabric",
  393. "clusterName": "[parameters('clusterName')]"
  394. }
  395. },
  396. {
  397. "apiVersion": "[variables('storageApiVersion')]",
  398. "type": "Microsoft.Storage/storageAccounts",
  399. "name": "[variables('uniqueStringArray0')[copyIndex()]]",
  400. "location": "[parameters('computeLocation')]",
  401. "dependsOn": [],
  402. "properties": {},
  403. "copy": {
  404. "name": "storageLoop",
  405. "count": 5
  406. },
  407. "kind": "Storage",
  408. "sku": {
  409. "name": "[parameters('storageAccountType')]"
  410. },
  411. "tags": {
  412. "resourceType": "Service Fabric",
  413. "clusterName": "[parameters('clusterName')]"
  414. }
  415. },
  416. {
  417. "apiVersion": "[variables('vmssApiVersion')]",
  418. "type": "Microsoft.Compute/virtualMachineScaleSets",
  419. "name": "[parameters('vmNodeType0Name')]",
  420. "location": "[parameters('computeLocation')]",
  421. "dependsOn": [
  422. "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
  423. "[concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[0])]",
  424. "[concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[1])]",
  425. "[concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[2])]",
  426. "[concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[3])]",
  427. "[concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[4])]",
  428. "[concat('Microsoft.Network/loadBalancers/', concat('LB','-', parameters('clusterName'),'-',parameters('vmNodeType0Name')))]",
  429. "[concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName'))]"
  430. ],
  431. "properties": {
  432. "overprovision": "[parameters('overProvision')]",
  433. "upgradePolicy": {
  434. "mode": "Automatic"
  435. },
  436. "virtualMachineProfile": {
  437. "extensionProfile": {
  438. "extensions": [
  439. {
  440. "name": "[concat(parameters('vmNodeType0Name'),'_ServiceFabricNode')]",
  441. "properties": {
  442. "type": "ServiceFabricNode",
  443. "autoUpgradeMinorVersion": true,
  444. "protectedSettings": {
  445. "StorageAccountKey1": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('supportLogStorageAccountName')),'2015-05-01-preview').key1]",
  446. "StorageAccountKey2": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('supportLogStorageAccountName')),'2015-05-01-preview').key2]"
  447. },
  448. "publisher": "Microsoft.Azure.ServiceFabric",
  449. "settings": {
  450. "clusterEndpoint": "[reference(parameters('clusterName')).clusterEndpoint]",
  451. "nodeTypeRef": "[parameters('vmNodeType0Name')]",
  452. "dataPath": "D:\\\\SvcFab",
  453. "durabilityLevel": "Bronze",
  454. "enableParallelJobs": true,
  455. "nicPrefixOverride": "[parameters('subnet0Prefix')]"
  456. },
  457. "typeHandlerVersion": "1.0"
  458. }
  459. }
  460. ]
  461. },
  462. "networkProfile": {
  463. "networkInterfaceConfigurations": [
  464. {
  465. "name": "[concat(parameters('nicName'), '-0')]",
  466. "properties": {
  467. "ipConfigurations": [
  468. {
  469. "name": "[concat(parameters('nicName'),'-',0)]",
  470. "properties": {
  471. "loadBalancerBackendAddressPools": [
  472. {
  473. "id": "[variables('lbPoolID0')]"
  474. }
  475. ],
  476. "loadBalancerInboundNatPools": [
  477. {
  478. "id": "[variables('lbNatPoolID0')]"
  479. }
  480. ],
  481. "subnet": {
  482. "id": "[variables('subnet0Ref')]"
  483. }
  484. }
  485. }
  486. ],
  487. "primary": true
  488. }
  489. }
  490. ]
  491. },
  492. "osProfile": {
  493. "adminPassword": "[parameters('adminPassword')]",
  494. "adminUsername": "[parameters('adminUsername')]",
  495. "computernamePrefix": "[parameters('vmNodeType0Name')]"
  496. },
  497. "storageProfile": {
  498. "imageReference": {
  499. "publisher": "[parameters('vmImagePublisher')]",
  500. "offer": "[parameters('vmImageOffer')]",
  501. "sku": "[parameters('vmImageSku')]",
  502. "version": "[parameters('vmImageVersion')]"
  503. },
  504. "osDisk": {
  505. "caching": "ReadOnly",
  506. "createOption": "FromImage",
  507. "vhdContainers": [
  508. "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[0]), variables('storageApiVersion')).primaryEndpoints.blob, parameters('vmStorageAccountContainerName'))]",
  509. "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[1]), variables('storageApiVersion')).primaryEndpoints.blob, parameters('vmStorageAccountContainerName'))]",
  510. "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[2]), variables('storageApiVersion')).primaryEndpoints.blob, parameters('vmStorageAccountContainerName'))]",
  511. "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[3]), variables('storageApiVersion')).primaryEndpoints.blob, parameters('vmStorageAccountContainerName'))]",
  512. "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('uniqueStringArray0')[4]), variables('storageApiVersion')).primaryEndpoints.blob, parameters('vmStorageAccountContainerName'))]"
  513. ],
  514. "name": "vmssosdisk"
  515. }
  516. }
  517. }
  518. },
  519. "sku": {
  520. "name": "[parameters('vmNodeType0Size')]",
  521. "capacity": "[parameters('nt0InstanceCount')]",
  522. "tier": "Standard"
  523. },
  524. "tags": {
  525. "resourceType": "Service Fabric",
  526. "clusterName": "[parameters('clusterName')]"
  527. }
  528. },
  529. {
  530. "apiVersion": "2017-07-01-preview",
  531. "type": "Microsoft.ServiceFabric/clusters",
  532. "name": "[parameters('clusterName')]",
  533. "location": "[parameters('clusterLocation')]",
  534. "dependsOn": [
  535. "[concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName'))]"
  536. ],
  537. "properties": {
  538. "clientCertificateCommonNames": [],
  539. "clientCertificateThumbprints": [],
  540. "clusterCodeVersion": "5.6.231.9494",
  541. "clusterState": "Default",
  542. "diagnosticsStorageAccountConfig": {
  543. "blobEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName')), variables('storageApiVersion')).primaryEndpoints.blob]",
  544. "protectedAccountKeyName": "StorageAccountKey1",
  545. "queueEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName')), variables('storageApiVersion')).primaryEndpoints.queue]",
  546. "storageAccountName": "[parameters('supportLogStorageAccountName')]",
  547. "tableEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName')), variables('storageApiVersion')).primaryEndpoints.table]"
  548. },
  549. "fabricSettings": [],
  550. "addonFeatures": [
  551. "DnsService"
  552. ],
  553. "managementEndpoint": "[concat('http://',reference(concat(parameters('lbIPName'),'-','0')).dnsSettings.fqdn,':',parameters('nt0fabricHttpGatewayPort'))]",
  554. "nodeTypes": [
  555. {
  556. "name": "[parameters('vmNodeType0Name')]",
  557. "applicationPorts": {
  558. "endPort": "[parameters('nt0applicationEndPort')]",
  559. "startPort": "[parameters('nt0applicationStartPort')]"
  560. },
  561. "clientConnectionEndpointPort": "[parameters('nt0fabricTcpGatewayPort')]",
  562. "durabilityLevel": "Bronze",
  563. "ephemeralPorts": {
  564. "endPort": "[parameters('nt0ephemeralEndPort')]",
  565. "startPort": "[parameters('nt0ephemeralStartPort')]"
  566. },
  567. "httpGatewayEndpointPort": "[parameters('nt0fabricHttpGatewayPort')]",
  568. "isPrimary": true,
  569. "reverseProxyEndpointPort": "[parameters('nt0reverseProxyEndpointPort')]",
  570. "vmInstanceCount": "[parameters('nt0InstanceCount')]"
  571. }
  572. ],
  573. "provisioningState": "Default",
  574. "reliabilityLevel": "None",
  575. "upgradeMode": "Manual",
  576. "vmImage": "Windows"
  577. },
  578. "tags": {
  579. "resourceType": "Service Fabric",
  580. "clusterName": "[parameters('clusterName')]"
  581. }
  582. }
  583. ],
  584. "outputs": {
  585. "clusterProperties": {
  586. "value": "[reference(parameters('clusterName'))]",
  587. "type": "object"
  588. }
  589. }
  590. }