Skip to content

Commit e936ac2

Browse files
Merge pull request #19 from peterpogorski/add-arm-template
Add ARM templates to deploy application
2 parents 1906698 + 9a0d77f commit e936ac2

File tree

2 files changed

+215
-0
lines changed

2 files changed

+215
-0
lines changed

ARM/UserApp.Parameters.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"clusterName": {
6+
"value": "GEN-UNIQUE"
7+
},
8+
"applicationTypeName": {
9+
"value": "VotingType"
10+
},
11+
"applicationTypeVersion": {
12+
"value": "1.0.0"
13+
},
14+
"appPackageUrl": {
15+
"value": "https://servicefabricapps.blob.core.windows.net/apps/Voting.sfpkg"
16+
},
17+
"applicationName": {
18+
"value":"Voting"
19+
},
20+
"serviceName": {
21+
"value": "Voting~VotingWeb"
22+
},
23+
"serviceTypeName": {
24+
"value": "VotingWebType"
25+
},
26+
"serviceName2": {
27+
"value": "Voting~VotingData"
28+
},
29+
"serviceTypeName2": {
30+
"value": "VotingDataType"
31+
}
32+
}
33+
}

ARM/UserApp.json

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"clusterName": {
6+
"type": "string",
7+
"defaultValue": "Cluster",
8+
"metadata": {
9+
"description": "Name of your cluster - Between 3 and 23 characters. Letters and numbers only."
10+
}
11+
},
12+
"applicationTypeName": {
13+
"type": "string",
14+
"defaultValue": "ApplicationType",
15+
"metadata": {
16+
"description": "The application type name."
17+
}
18+
},
19+
"applicationTypeVersion": {
20+
"type": "string",
21+
"defaultValue": "1",
22+
"metadata": {
23+
"description": "The application type version."
24+
}
25+
},
26+
"appPackageUrl": {
27+
"type": "string",
28+
"metadata": {
29+
"description": "The URL to the application package sfpkg file."
30+
}
31+
},
32+
"applicationName": {
33+
"type": "string",
34+
"defaultValue": "Application1",
35+
"metadata": {
36+
"description": "The name of the application resource."
37+
}
38+
},
39+
"serviceName": {
40+
"type": "string",
41+
"defaultValue": "Service1",
42+
"metadata": {
43+
"description": "The name of the service resource in the format of {applicationName}~{serviceName}."
44+
}
45+
},
46+
"serviceTypeName": {
47+
"type": "string",
48+
"defaultValue": "Service1Type",
49+
"metadata": {
50+
"description": "The name of the service type."
51+
}
52+
},
53+
"serviceName2": {
54+
"type": "string",
55+
"defaultValue": "Service2",
56+
"metadata": {
57+
"description": "The name of the service resource in the format of {applicationName}~{serviceName}."
58+
}
59+
},
60+
"serviceTypeName2": {
61+
"type": "string",
62+
"defaultValue": "Service2Type",
63+
"metadata": {
64+
"description": "The name of the service type."
65+
}
66+
}
67+
},
68+
"variables": {
69+
"clusterLocation": "[resourcegroup().location]"
70+
},
71+
"resources": [
72+
{
73+
"apiVersion": "2019-03-01",
74+
"type": "Microsoft.ServiceFabric/clusters/applicationTypes",
75+
"name": "[concat(parameters('clusterName'), '/', parameters('applicationTypeName'))]",
76+
"location": "[variables('clusterLocation')]",
77+
"dependsOn": [],
78+
"properties": {
79+
"provisioningState": "Default"
80+
}
81+
},
82+
{
83+
"apiVersion": "2019-03-01",
84+
"type": "Microsoft.ServiceFabric/clusters/applicationTypes/versions",
85+
"name": "[concat(parameters('clusterName'), '/', parameters('applicationTypeName'), '/', parameters('applicationTypeVersion'))]",
86+
"location": "[variables('clusterLocation')]",
87+
"dependsOn": [
88+
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applicationTypes/', parameters('applicationTypeName'))]"
89+
],
90+
"properties": {
91+
"provisioningState": "Default",
92+
"appPackageUrl": "[parameters('appPackageUrl')]"
93+
}
94+
},
95+
{
96+
"apiVersion": "2019-03-01",
97+
"type": "Microsoft.ServiceFabric/clusters/applications",
98+
"name": "[concat(parameters('clusterName'), '/', parameters('applicationName'))]",
99+
"location": "[variables('clusterLocation')]",
100+
"dependsOn": [
101+
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applicationTypes/', parameters('applicationTypeName'), '/versions/', parameters('applicationTypeVersion'))]"
102+
],
103+
"properties": {
104+
"provisioningState": "Default",
105+
"typeName": "[parameters('applicationTypeName')]",
106+
"typeVersion": "[parameters('applicationTypeVersion')]",
107+
"parameters": {},
108+
"upgradePolicy": {
109+
"upgradeReplicaSetCheckTimeout": "01:00:00.0",
110+
"forceRestart": "false",
111+
"rollingUpgradeMonitoringPolicy": {
112+
"healthCheckWaitDuration": "00:02:00.0",
113+
"healthCheckStableDuration": "00:05:00.0",
114+
"healthCheckRetryTimeout": "00:10:00.0",
115+
"upgradeTimeout": "01:00:00.0",
116+
"upgradeDomainTimeout": "00:20:00.0"
117+
},
118+
"applicationHealthPolicy": {
119+
"considerWarningAsError": "false",
120+
"maxPercentUnhealthyDeployedApplications": "50",
121+
"defaultServiceTypeHealthPolicy": {
122+
"maxPercentUnhealthyServices": "50",
123+
"maxPercentUnhealthyPartitionsPerService": "50",
124+
"maxPercentUnhealthyReplicasPerPartition": "50"
125+
}
126+
}
127+
}
128+
}
129+
},
130+
{
131+
"apiVersion": "2019-03-01",
132+
"type": "Microsoft.ServiceFabric/clusters/applications/services",
133+
"name": "[concat(parameters('clusterName'), '/', parameters('applicationName'), '/', parameters('serviceName'))]",
134+
"location": "[variables('clusterLocation')]",
135+
"dependsOn": [
136+
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applications/', parameters('applicationName'))]"
137+
],
138+
"properties": {
139+
"provisioningState": "Default",
140+
"serviceKind": "Stateless",
141+
"serviceTypeName": "[parameters('serviceTypeName')]",
142+
"instanceCount": "-1",
143+
"partitionDescription": {
144+
"partitionScheme": "Singleton"
145+
},
146+
"serviceLoadMetrics": [],
147+
"servicePlacementPolicies": [],
148+
"defaultMoveCost": ""
149+
}
150+
},
151+
{
152+
"apiVersion": "2019-03-01",
153+
"type": "Microsoft.ServiceFabric/clusters/applications/services",
154+
"name": "[concat(parameters('clusterName'), '/', parameters('applicationName'), '/', parameters('serviceName2'))]",
155+
"location": "[variables('clusterLocation')]",
156+
"dependsOn": [
157+
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applications/', parameters('applicationName'))]"
158+
],
159+
"properties": {
160+
"provisioningState": "Default",
161+
"serviceKind": "Stateful",
162+
"serviceTypeName": "[parameters('serviceTypeName2')]",
163+
"targetReplicaSetSize": "3",
164+
"minReplicaSetSize": "2",
165+
"replicaRestartWaitDuration": "00:01:00.0",
166+
"quorumLossWaitDuration": "00:02:00.0",
167+
"standByReplicaKeepDuration": "00:00:30.0",
168+
"partitionDescription": {
169+
"partitionScheme": "UniformInt64Range",
170+
"count": "5",
171+
"lowKey": "1",
172+
"highKey": "5"
173+
},
174+
"hasPersistedState": "true",
175+
"correlationScheme": [],
176+
"serviceLoadMetrics": [],
177+
"servicePlacementPolicies": [],
178+
"defaultMoveCost": "Low"
179+
}
180+
}
181+
]
182+
}

0 commit comments

Comments
 (0)