This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtemplate-BuildwebILB.json
121 lines (116 loc) · 3.84 KB
/
template-BuildwebILB.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string",
"metadata": {
"description": "Name of the existing VM to apply the DSC configuration to"
}
},
"numberOfInstances": {
"type": "int",
"defaultValue": 2,
"metadata": {
"Description": "Number of Azure VM to create."
}
},
"DomainName": {
"type": "string",
"metadata": {
"description": "Name Domain"
}
},
"DeploymentName": {
"type": "string",
"defaultValue": "",
"minLength": 3,
"metadata": {
"description": "Name for the LoadBalancer."
}
},
"WebILBName": {
"type": "string",
"defaultValue": "",
"minLength": 3,
"metadata": {
"description": "Name for the LoadBalancer."
}
},
"SQLILBName": {
"type": "string",
"defaultValue": "none",
"metadata": {
"description": "Optional Name for the LoadBalancer."
}
},
"WebHookKey": {
"type": "securestring",
"metadata": {
"description": "The ILB Runbook ResourceGroup"
}
},
"Dashboardsvr": {
"type": "securestring",
"metadata": {
"description": "The Dashboard svr"
}
},
"NestedBaseURL": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Base URL for nested scripts & templates"
}
},
"SASToken": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "SAS token to access blob/container"
}
},
"customScriptRelativeFolderPath": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Relative folder path of the custom script"
}
}
},
"variables": {
"scriptsURL": "[concat(parameters('NestedBaseURL'),'/all-scripts/')]",
"nestedURL": "[concat(parameters('NestedBaseURL'),'/all-nested/')]",
"SASToken": "[trim(parameters('SASToken'))]",
"vmILBExtensionName": "ConfigureWebILB",
"customILBScriptFileName": "Configure-WebILB.ps1",
"customILBScriptFilePath": "[concat(parameters('customScriptRelativeFolderPath'),variables('customILBScriptFileName'))]",
"customILBScriptFileToRun": "[concat(variables('customILBScriptFileName'),variables('SASToken'))]",
"customILBScriptFileUri": "[concat(variables('scriptsURL'),variables('customILBScriptFileToRun'))]",
"ILBarguments": "[concat(' -DeploymentName ', parameters('DeploymentName'), ' -SubscriptionId ',subscription().subscriptionId, ' -servernamepart ', parameters('vmName'), ' -domain ', parameters('DomainName'), ' -InstanceCount ', parameters('numberOfInstances'),' -SQLILBName ', parameters('SQLILBName'), ' -WebILBName ', parameters('WebILBName'), ' -WebHookKey ', parameters('WebHookKey'), ' -Dashboardsvr ', parameters('Dashboardsvr'))]",
"ILBcommandToExecute": "[concat('powershell.exe -ExecutionPolicy Unrestricted -File', ' ', variables('customILBScriptFilePath'), ' ', variables('ILBarguments'))]"
},
"resources": [
{
"apiVersion": "2015-05-01-preview",
"name": "[concat(parameters('vmName'),'1','/', variables('vmILBExtensionName'))]",
"type": "Microsoft.Compute/virtualMachines/extensions",
"location": "[resourceGroup().location]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.7",
"autoUpgradeMinorVersion": "true",
"forceUpdateTag": "v.1.4",
"settings": {
"fileUris": [
"[variables('customILBScriptFileUri')]"
]
},
"protectedSettings": {
"commandToExecute": "[variables('ILBcommandToExecute')]"
}
}
}
]
}