Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"value": "ClusterName"
},
"loggingFilter": {
"value": "Verbose"
},
"adminUserName": {
"value": "AdminUserName"
},
"adminPassword": {
"value": "AdminPassword"
},
"vmNodeType0Name": {
"value": "SmallNode"
},
"vmNodeType0Size": {
"value": "Standard_A1"
},
"applicationStartPort": {
"value": 20000
},
"applicationEndPort": {
"value": 30000
},
"ephemeralStartPort": {
"value": 49152
},
"ephemeralEndPort": {
"value": 65534
},
"fabricTcpGatewayPort": {
"value": 19000
},
"fabricHttpGatewayPort": {
"value": 19080
},
"vmStorageAccountContainerName": {
"value": "vhds"
},
"addressPrefix": {
"value": "10.0.0.0/16"
},
"subnet1Name": {
"value": "Subnet-1"
},
"subnet2Name": {
"value": "Subnet-2"
},
"subnet1Prefix": {
"value": "10.0.0.0/24"
},
"subnet2Prefix": {
"value": "10.0.1.0/24"
},
"vmImagePublisher": {
"value": "MicrosoftWindowsServer"
},
"vmImageOffer": {
"value": "WindowsServer"
},
"vmImageSku": {
"value": "2012-R2-Datacenter"
},
"vmImageVersion": {
"value": "latest"
},
"loadBalancedAppPort1": {
"value": 80
},
"loadBalancedAppPort2": {
"value": 443
},
"storageAccountType": {
"value": "Standard_LRS"
},
"supportLogStorageAccountType": {
"value": "Standard_LRS"
},
"applicationDiagnosticsStorageAccountType": {
"value": "Standard_LRS"
}
}
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"type": "string",
"defaultValue": "Cluster",
"metadata": {
"description": "Name of your cluster - Between 3 and 23 characters. Lowercase letters and numbers"
}
},
"loggingFilter": {
"type": "string",
"defaultValue": "Informational",
"allowedValues": [
"Verbose",
"Informational"
],
"metadata": {
"description": "The logging level for application logs"
}
},
"applicationStartPort": {
"type": "int",
"defaultValue": 20000
},
"applicationEndPort": {
"type": "int",
"defaultValue": 30000
},
"ephemeralStartPort": {
"type": "int",
"defaultValue": 49152
},
"ephemeralEndPort": {
"type": "int",
"defaultValue": 65534
},
"fabricTcpGatewayPort": {
"type": "int",
"defaultValue": 19000,
"metadata": {
"description": "TCP Client Connection end point to perform management operations on this cluster"
}
},
"fabricHttpGatewayPort": {
"type": "int",
"defaultValue": 19080,
"metadata": {
"description": "Http Client Connection end point to perform management operations on this cluster"
}
},
"vmStorageAccountContainerName": {
"type": "string",
"defaultValue": "vhds"
},
"adminUserName": {
"type": "string",
"defaultValue": "testadm"
},
"adminPassword": {
"type": "securestring"
},
"addressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16"
},
"subnet1Name": {
"type": "string",
"defaultValue": "Subnet-1"
},
"subnet2Name": {
"type": "string",
"defaultValue": "Subnet-2"
},
"subnet1Prefix": {
"type": "string",
"defaultValue": "10.0.0.0/24"
},
"subnet2Prefix": {
"type": "string",
"defaultValue": "10.0.1.0/24"
},
"vmImagePublisher": {
"type": "string",
"defaultValue": "MicrosoftWindowsServer"
},
"vmImageOffer": {
"type": "string",
"defaultValue": "WindowsServer"
},
"vmImageSku": {
"type": "string",
"defaultValue": "2012-R2-Datacenter"
},
"vmImageVersion": {
"type": "string",
"defaultValue": "latest"
},
"loadBalancedAppPort1": {
"type": "int",
"defaultValue": 80
},
"loadBalancedAppPort2": {
"type": "int",
"defaultValue": 443
},
"storageAccountType": {
"type": "string",
"allowedValues": [
"Standard_LRS",
"Standard_GRS"
],
"defaultValue": "Standard_LRS",
"metadata": {
"description": "Replication option for the VM image storage account"
}
},
"supportLogStorageAccountType": {
"type": "string",
"allowedValues": [
"Standard_LRS",
"Standard_GRS"
],
"defaultValue": "Standard_LRS",
"metadata": {
"description": "Replication option for the support log storage account"
}
},
"applicationDiagnosticsStorageAccountType": {
"type": "string",
"allowedValues": [
"Standard_LRS",
"Standard_GRS"
],
"defaultValue": "Standard_LRS",
"metadata": {
"description": "Replication option for the application diagnostics storage account"
}
},
"vmNodeType0Name": {
"type": "string",
"defaultValue": "MediumNode"
},
"vmNodeType0Size": {
"type": "string",
"defaultValue": "Standard_A2"
}
},
"variables": {
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',concat('VNet-', parameters('clusterName')))]",
"subnet1Ref": "[concat(variables('vnetID'),'/subnets/',parameters('subnet1Name'))]",
"lbID0": "[resourceId('Microsoft.Network/loadBalancers',concat('LB-',parameters('clusterName'),'-','0'))]",
"lbIPConfig0": "[concat(variables('lbID0'),'/frontendIPConfigurations/LoadBalancerIPConfig')]",
"lbPoolID0": "[concat(variables('lbID0'),'/backendAddressPools/LoadBalancerBEAddressPool')]",
"lbProbeID0": "[concat(variables('lbID0'),'/probes/FabricGatewayProbe')]",
"lbHttpProbeID0": "[concat(variables('lbID0'),'/probes/FabricHttpGatewayProbe')]"
},
"resources": [
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat(parameters('clusterName'), 'vms')]",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[parameters('storageAccountType')]"
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat(parameters('clusterName'),'supportlogs')]",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[parameters('supportLogStorageAccountType')]"
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat(parameters('clusterName'),'applicationlogs')]",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[parameters('applicationDiagnosticsStorageAccountType')]"
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/virtualNetworks",
"name": "[concat('VNet-', parameters('clusterName'))]",
"location": "[resourceGroup().location]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('addressPrefix')]"
]
},
"subnets": [
{
"name": "[parameters('subnet1Name')]",
"properties": {
"addressPrefix": "[parameters('subnet1Prefix')]"
}
},
{
"name": "[parameters('subnet2Name')]",
"properties": {
"addressPrefix": "[parameters('subnet2Prefix')]"
}
}
]
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/availabilitySets",
"name": "[concat('AS-',parameters('clusterName'),'-',0)]",
"location": "[resourceGroup().location]",
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat('NIC-', parameters('clusterName'),'-',0,'-',copyIndex(0))]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', concat('VNet-', parameters('clusterName')))]",
"[concat('Microsoft.Network/loadBalancers/', 'LB-',parameters('clusterName'),'-','0')]"
],
"properties": {
"ipConfigurations": [
{
"name": "IPConfig",
"properties": {
"loadBalancerBackendAddressPools": [
{
"id": "[variables('lbPoolID0')]"
}
],
"loadBalancerInboundNatRules": [
{
"id": "[concat(variables('lbID0'),'/inboundNatRules/RDP-VM-0-',copyIndex(0))]"
}
],
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnet1Ref')]"
}
}
}
]
},
"copy": {
"name": "nicLoop",
"count": 5
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('vmNodeType0Name'),copyIndex(0),'/ServiceFabricNode')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNodeType0Name'), copyIndex(0))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('clusterName'),'supportlogs')]"
],
"properties": {
"type": "ServiceFabricNode",
"autoUpgradeMinorVersion": false,
"protectedSettings": {
"StorageAccountKey1": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', concat(parameters('clusterName'),'supportlogs')),'2015-05-01-preview').key1]",
"StorageAccountKey2": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', concat(parameters('clusterName'),'supportlogs')),'2015-05-01-preview').key2]"
},
"publisher": "Microsoft.Azure.ServiceFabric",
"settings": {
"clusterEndpoint": "[reference(parameters('clusterName')).clusterEndpoint]",
"nodeTypeRef": "MediumNode"
},
"typeHandlerVersion": "1.0"
},
"copy": {
"name": "vmExtensionLoop",
"count": 5
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('vmNodeType0Name'),copyIndex(0),'/Microsoft.Insights.VMDiagnosticsSettings')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNodeType0Name'), copyIndex(0))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('clusterName'),'applicationlogs')]",
"[concat('Microsoft.Compute/virtualMachines/',parameters('vmNodeType0Name'),copyIndex(0),'/extensions/ServiceFabricNode')]"
],
"properties": {
"type": "IaaSDiagnostics",
"autoUpgradeMinorVersion": true,
"protectedSettings": {
"storageAccountName": "[concat(parameters('clusterName'),'applicationlogs')]",
"storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', concat(parameters('clusterName'),'applicationlogs')),'2015-05-01-preview').key1]",
"storageAccountEndPoint": "https://core.windows.net/"
},
"publisher": "Microsoft.Azure.Diagnostics",
"settings": {
"WadCfg": {
"DiagnosticMonitorConfiguration": {
"overallQuotaInMB": "50000",
"PerformanceCounters": {
"PerformanceCounterConfiguration": [
{
"counterSpecifier": "\\Memory\\Available MBytes",
"sampleRate": "PT3M"
},
{
"counterSpecifier": "\\Processor(_Total)\\% Processor Time",
"sampleRate": "PT3M"
}
]
},
"EtwProviders": {
"EtwEventSourceProviderConfiguration": [
{
"provider": "Microsoft-ServiceFabric-Actors",
"scheduledTransferKeywordFilter": "1",
"scheduledTransferPeriod": "PT5M",
"DefaultEvents": {
"eventDestination": "ServiceFabricReliableActorEventTable"
}
},
{
"provider": "Microsoft-ServiceFabric-Services",
"scheduledTransferPeriod": "PT5M",
"DefaultEvents": {
"eventDestination": "ServiceFabricReliableServiceEventTable"
}
}
],
"EtwManifestProviderConfiguration": [
{
"provider": "cbd93bc2-71e5-4566-b3a7-595d8eeca6e8",
"scheduledTransferLogLevelFilter": "Information",
"scheduledTransferKeywordFilter": "4611686018427387904",
"scheduledTransferPeriod": "PT5M",
"DefaultEvents": {
"eventDestination": "ServiceFabricSystemEventTable"
}
}
]
}
}
},
"StorageAccount": "[concat(parameters('clusterName'),'applicationlogs')]"
},
"typeHandlerVersion": "1.5"
},
"copy": {
"name": "vmExtensionLoop",
"count": 5
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('vmNodeType0Name'),copyIndex(0))]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/availabilitySets/', 'AS-',parameters('clusterName'),'-',0)]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('clusterName'), 'vms')]",
"[concat('Microsoft.Network/networkInterfaces/', concat('NIC-', parameters('clusterName'),'-',0,'-',copyIndex(0)))]"
],
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', concat('AS-',parameters('clusterName'),'-',0))]"
},
"hardwareProfile": {
"vmSize": "[parameters('vmNodeType0Size')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat('NIC-', parameters('clusterName'),'-',0,'-',copyIndex(0)))]"
}
]
},
"osProfile": {
"adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]",
"computername": "[concat(parameters('vmNodeType0Name'),copyIndex(0))]",
"windowsConfiguration": {
"enableAutomaticUpdates": false,
"provisionVMAgent": true
}
},
"storageProfile": {
"imageReference": {
"publisher": "[parameters('vmImagePublisher')]",
"offer": "[parameters('vmImageOffer')]",
"sku": "[parameters('vmImageSku')]",
"version": "[parameters('vmImageVersion')]"
},
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://',concat(parameters('clusterName'), 'vms'),'.blob.core.windows.net/',parameters('vmStorageAccountContainerName'),'/',resourcegroup().name,'-',parameters('vmNodeType0Name'),copyIndex(0),'.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
}
},
"copy": {
"name": "vmLoop",
"count": 5
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[concat('LBIP-',parameters('clusterName'),'-','0')]",
"location": "[resourceGroup().location]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[parameters('clusterName')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/loadBalancers",
"name": "[concat('LB-',parameters('clusterName'),'-','0')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/',concat('LBIP-',parameters('clusterName'),'-','0'))]"
],
"properties": {
"frontendIPConfigurations": [
{
"name": "LoadBalancerIPConfig",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',concat('LBIP-',parameters('clusterName'),'-','0'))]"
}
}
}
],
"backendAddressPools": [
{
"name": "LoadBalancerBEAddressPool",
"properties": { }
}
],
"inboundNatRules": [
{
"name": "RDP-VM-0-0",
"properties": {
"backendPort": "3389",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "33000",
"protocol": "tcp"
}
},
{
"name": "RDP-VM-0-1",
"properties": {
"backendPort": "3389",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "33001",
"protocol": "tcp"
}
},
{
"name": "RDP-VM-0-2",
"properties": {
"backendPort": "3389",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "33002",
"protocol": "tcp"
}
},
{
"name": "RDP-VM-0-3",
"properties": {
"backendPort": "3389",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "33003",
"protocol": "tcp"
}
},
{
"name": "RDP-VM-0-4",
"properties": {
"backendPort": "3389",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "33004",
"protocol": "tcp"
}
}
],
"loadBalancingRules": [
{
"name": "LBRule",
"properties": {
"backendAddressPool": {
"id": "[variables('lbPoolID0')]"
},
"backendPort": "[parameters('fabricTcpGatewayPort')]",
"enableFloatingIP": "false",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "[parameters('fabricTcpGatewayPort')]",
"idleTimeoutInMinutes": "5",
"probe": {
"id": "[variables('lbProbeID0')]"
},
"protocol": "tcp"
}
},
{
"name": "LBHttpRule",
"properties": {
"backendAddressPool": {
"id": "[variables('lbPoolID0')]"
},
"backendPort": "[parameters('fabricHttpGatewayPort')]",
"enableFloatingIP": "false",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "[parameters('fabricHttpGatewayPort')]",
"idleTimeoutInMinutes": "5",
"probe": {
"id": "[variables('lbHttpProbeID0')]"
},
"protocol": "tcp"
}
},
{
"name": "AppPortLBRule1",
"properties": {
"backendAddressPool": {
"id": "[variables('lbPoolID0')]"
},
"backendPort": "[parameters('loadBalancedAppPort1')]",
"enableFloatingIP": "false",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "[parameters('loadBalancedAppPort1')]",
"idleTimeoutInMinutes": "5",
"probe": {
"id": "[concat(variables('lbID0'),'/probes/AppPortProbe1')]"
},
"protocol": "tcp"
}
},
{
"name": "AppPortLBRule2",
"properties": {
"backendAddressPool": {
"id": "[variables('lbPoolID0')]"
},
"backendPort": "[parameters('loadBalancedAppPort2')]",
"enableFloatingIP": "false",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
"frontendPort": "[parameters('loadBalancedAppPort2')]",
"idleTimeoutInMinutes": "5",
"probe": {
"id": "[concat(variables('lbID0'),'/probes/AppPortProbe2')]"
},
"protocol": "tcp"
}
}
],
"probes": [
{
"name": "FabricGatewayProbe",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": "[parameters('fabricTcpGatewayPort')]",
"protocol": "tcp"
}
},
{
"name": "FabricHttpGatewayProbe",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": "[parameters('fabricHttpGatewayPort')]",
"protocol": "tcp"
}
},
{
"name": "AppPortProbe1",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": "[parameters('loadBalancedAppPort1')]",
"protocol": "tcp"
}
},
{
"name": "AppPortProbe2",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": "[parameters('loadBalancedAppPort2')]",
"protocol": "tcp"
}
}
]
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
},
{
"apiVersion": "2015-01-01-alpha",
"type": "Microsoft.ServiceFabric/clusters",
"name": "[parameters('clusterName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('clusterName'),'supportlogs')]"
],
"properties": {
"diagnosticsStorageAccountConfig": {
"blobEndpoint": "[concat('https://',parameters('clusterName'),'supportlogs','.blob.core.windows.net/')]",
"protectedAccountKeyName": "StorageAccountKey1",
"queueEndpoint": "[concat('https://',parameters('clusterName'),'supportlogs','.queue.core.windows.net/')]",
"storageAccountName": "[concat(parameters('clusterName'),'supportlogs')]",
"tableEndpoint": "[concat('https://',parameters('clusterName'),'supportlogs','.table.core.windows.net/')]"
},
"expectedVMResources": [
{
"name": "[parameters('vmNodeType0Name')]",
"nodeTypeRef": "MediumNode",
"vmInstanceCount": 5
}
],
"fabricSettings": [ ],
"managementEndpoint": "[concat('http://',reference(concat('LBIP-',parameters('clusterName'),'-','0')).dnsSettings.fqdn,':',parameters('fabricHttpGatewayPort'))]",
"nodeTypes": [
{
"name": "MediumNode",
"applicationPorts": {
"endPort": "[parameters('applicationEndPort')]",
"startPort": "[parameters('applicationStartPort')]"
},
"clientConnectionEndpointPort": "[parameters('fabricTcpGatewayPort')]",
"ephemeralPorts": {
"endPort": "[parameters('ephemeralEndPort')]",
"startPort": "[parameters('ephemeralStartPort')]"
},
"httpGatewayEndpointPort": "[parameters('fabricHttpGatewayPort')]",
"isPrimary": true
}
]
},
"tags": {
"resourceType": "Service Fabric",
"clusterName": "[parameters('clusterName')]"
}
}
],
"outputs": {
"clusterProperties": {
"value": "[reference(parameters('clusterName'))]",
"type": "object"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.