{ "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "contentVersion": "1.0.0.0", "parameters": { "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location of the resources (e.g. westus, eastus, westeurope)." } }, "stateFolderName": { "type": "string", "defaultValue": "CounterService", "metadata": { "description": "Folder in which to store the state. Provide a empty value to create a unique folder for each container to store the state. A non-empty value will retain the state across deployments, however if more than one applications are using the same folder, the counter may update more frequently." } } }, "resources": [ { "apiVersion": "2018-09-01-preview", "name": "counterNetwork", "type": "Microsoft.ServiceFabricMesh/networks", "location": "[parameters('location')]", "dependsOn": [], "properties": { "kind": "Local", "description": "Azure Service Fabric Mesh Counter Application network.", "networkAddressPrefix": "10.0.0.0/24" } }, { "apiVersion": "2018-09-01-preview", "name": "counterApp", "type": "Microsoft.ServiceFabricMesh/applications", "location": "[parameters('location')]", "dependsOn": [ "Microsoft.ServiceFabricMesh/networks/counterNetwork" ], "properties": { "description": "Azure Service Fabric Mesh Counter Application.", "services": [ { "name": "counterService", "properties": { "description": "A web service that serves the counter value stored in Service Fabric Reliable volume.", "osType": "linux", "codePackages": [ { "name": "counterCode", "image": "seabreeze/azure-mesh-counter:0.5-alpine", "volumes": [ { "name": "sfvol", "creationParameters": { "kind": "ServiceFabricVolumeDisk", "sizeDisk": "Small" }, "destinationPath": "/app/data" } ], "endpoints": [ { "name": "counterServiceListener", "port": 80 } ], "environmentVariables": [ { "name": "STATE_FOLDER_NAME", "value": "[parameters('stateFolderName')]" } ], "resources": { "requests": { "cpu": 0.5, "memoryInGB": 0.5 } } } ], "replicaCount": 1, "networkRefs": [ { "name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'counterNetwork')]", "endpointRefs": [ { "name": "counterServiceListener" } ] } ] } } ] } }, { "apiVersion": "2018-09-01-preview", "name": "counterGateway", "type": "Microsoft.ServiceFabricMesh/gateways", "location": "[parameters('location')]", "dependsOn": [ "Microsoft.ServiceFabricMesh/networks/counterNetwork" ], "properties": { "description": "Service Fabric Mesh Gateway for counter sample.", "sourceNetwork": { "name": "Open" }, "destinationNetwork": { "name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'counterNetwork')]" }, "tcp": [ { "name": "web", "port": 80, "destination": { "applicationName": "counterApp", "serviceName": "counterService", "endpointName": "counterServiceListener" } } ] } } ], "outputs": { "publicIPAddress": { "value": "[reference('counterGateway').ipAddress]", "type": "string" } } }