Skip to content

Commit

Permalink
Add ARM templates to deploy application
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpogorski committed Aug 7, 2019
1 parent 9e12c0d commit 9a0d77f
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 0 deletions.
33 changes: 33 additions & 0 deletions ARM/UserApp.Parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"value": "GEN-UNIQUE"
},
"applicationTypeName": {
"value": "VotingType"
},
"applicationTypeVersion": {
"value": "1.0.0"
},
"appPackageUrl": {
"value": "https://servicefabricapps.blob.core.windows.net/apps/Voting.sfpkg"
},
"applicationName": {
"value":"Voting"
},
"serviceName": {
"value": "Voting~VotingWeb"
},
"serviceTypeName": {
"value": "VotingWebType"
},
"serviceName2": {
"value": "Voting~VotingData"
},
"serviceTypeName2": {
"value": "VotingDataType"
}
}
}
182 changes: 182 additions & 0 deletions ARM/UserApp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
{
"$schema": "http://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. Letters and numbers only."
}
},
"applicationTypeName": {
"type": "string",
"defaultValue": "ApplicationType",
"metadata": {
"description": "The application type name."
}
},
"applicationTypeVersion": {
"type": "string",
"defaultValue": "1",
"metadata": {
"description": "The application type version."
}
},
"appPackageUrl": {
"type": "string",
"metadata": {
"description": "The URL to the application package sfpkg file."
}
},
"applicationName": {
"type": "string",
"defaultValue": "Application1",
"metadata": {
"description": "The name of the application resource."
}
},
"serviceName": {
"type": "string",
"defaultValue": "Service1",
"metadata": {
"description": "The name of the service resource in the format of {applicationName}~{serviceName}."
}
},
"serviceTypeName": {
"type": "string",
"defaultValue": "Service1Type",
"metadata": {
"description": "The name of the service type."
}
},
"serviceName2": {
"type": "string",
"defaultValue": "Service2",
"metadata": {
"description": "The name of the service resource in the format of {applicationName}~{serviceName}."
}
},
"serviceTypeName2": {
"type": "string",
"defaultValue": "Service2Type",
"metadata": {
"description": "The name of the service type."
}
}
},
"variables": {
"clusterLocation": "[resourcegroup().location]"
},
"resources": [
{
"apiVersion": "2019-03-01",
"type": "Microsoft.ServiceFabric/clusters/applicationTypes",
"name": "[concat(parameters('clusterName'), '/', parameters('applicationTypeName'))]",
"location": "[variables('clusterLocation')]",
"dependsOn": [],
"properties": {
"provisioningState": "Default"
}
},
{
"apiVersion": "2019-03-01",
"type": "Microsoft.ServiceFabric/clusters/applicationTypes/versions",
"name": "[concat(parameters('clusterName'), '/', parameters('applicationTypeName'), '/', parameters('applicationTypeVersion'))]",
"location": "[variables('clusterLocation')]",
"dependsOn": [
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applicationTypes/', parameters('applicationTypeName'))]"
],
"properties": {
"provisioningState": "Default",
"appPackageUrl": "[parameters('appPackageUrl')]"
}
},
{
"apiVersion": "2019-03-01",
"type": "Microsoft.ServiceFabric/clusters/applications",
"name": "[concat(parameters('clusterName'), '/', parameters('applicationName'))]",
"location": "[variables('clusterLocation')]",
"dependsOn": [
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applicationTypes/', parameters('applicationTypeName'), '/versions/', parameters('applicationTypeVersion'))]"
],
"properties": {
"provisioningState": "Default",
"typeName": "[parameters('applicationTypeName')]",
"typeVersion": "[parameters('applicationTypeVersion')]",
"parameters": {},
"upgradePolicy": {
"upgradeReplicaSetCheckTimeout": "01:00:00.0",
"forceRestart": "false",
"rollingUpgradeMonitoringPolicy": {
"healthCheckWaitDuration": "00:02:00.0",
"healthCheckStableDuration": "00:05:00.0",
"healthCheckRetryTimeout": "00:10:00.0",
"upgradeTimeout": "01:00:00.0",
"upgradeDomainTimeout": "00:20:00.0"
},
"applicationHealthPolicy": {
"considerWarningAsError": "false",
"maxPercentUnhealthyDeployedApplications": "50",
"defaultServiceTypeHealthPolicy": {
"maxPercentUnhealthyServices": "50",
"maxPercentUnhealthyPartitionsPerService": "50",
"maxPercentUnhealthyReplicasPerPartition": "50"
}
}
}
}
},
{
"apiVersion": "2019-03-01",
"type": "Microsoft.ServiceFabric/clusters/applications/services",
"name": "[concat(parameters('clusterName'), '/', parameters('applicationName'), '/', parameters('serviceName'))]",
"location": "[variables('clusterLocation')]",
"dependsOn": [
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applications/', parameters('applicationName'))]"
],
"properties": {
"provisioningState": "Default",
"serviceKind": "Stateless",
"serviceTypeName": "[parameters('serviceTypeName')]",
"instanceCount": "-1",
"partitionDescription": {
"partitionScheme": "Singleton"
},
"serviceLoadMetrics": [],
"servicePlacementPolicies": [],
"defaultMoveCost": ""
}
},
{
"apiVersion": "2019-03-01",
"type": "Microsoft.ServiceFabric/clusters/applications/services",
"name": "[concat(parameters('clusterName'), '/', parameters('applicationName'), '/', parameters('serviceName2'))]",
"location": "[variables('clusterLocation')]",
"dependsOn": [
"[concat('Microsoft.ServiceFabric/clusters/', parameters('clusterName'), '/applications/', parameters('applicationName'))]"
],
"properties": {
"provisioningState": "Default",
"serviceKind": "Stateful",
"serviceTypeName": "[parameters('serviceTypeName2')]",
"targetReplicaSetSize": "3",
"minReplicaSetSize": "2",
"replicaRestartWaitDuration": "00:01:00.0",
"quorumLossWaitDuration": "00:02:00.0",
"standByReplicaKeepDuration": "00:00:30.0",
"partitionDescription": {
"partitionScheme": "UniformInt64Range",
"count": "5",
"lowKey": "1",
"highKey": "5"
},
"hasPersistedState": "true",
"correlationScheme": [],
"serviceLoadMetrics": [],
"servicePlacementPolicies": [],
"defaultMoveCost": "Low"
}
}
]
}

0 comments on commit 9a0d77f

Please sign in to comment.