{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "storageAccountType": { "type": "string", "defaultValue": "Standard_LRS", "allowedValues": [ "Standard_LRS", "Standard_GRS", "Standard_ZRS" ], "metadata": { "description": "Storage Account type" } }, "image": { "type": "string", "defaultValue": "fgauna12/gaunastressyou:1.0.0", "metadata": { "description": "The container image name" } }, "loadTestName": { "type": "string", "metadata": { "description": "The name of the load test" } }, "artillery-environment": { "type": "string", "metadata": { "description": "" } }, "artillery-file": { "type": "string", "metadata": { "description": "" } } }, "variables": { "cpuCores": "0.5", "memoryInGb": "0.7", "storageAccountName": "[concat('results', uniquestring(resourceGroup().id))]", "containerGroupName": "[concat('artillery-', parameters('loadTestName'), '-', replace(parameters('artillery-file'), '.', '-'))]" }, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "name": "[variables('storageAccountName')]", "apiVersion": "2017-10-01", "location": "[resourceGroup().location]", "sku": { "name": "[parameters('storageAccountType')]" }, "kind": "Storage", "tags": { "[concat(parameters('loadTestName'), ' Load Test')]": "[parameters('artillery-environment')]" }, "properties": {} }, { "name": "[variables('containerGroupName')]", "type": "Microsoft.ContainerInstance/containerGroups", "apiVersion": "2018-02-01-preview", "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]" ], "tags": { "[concat(parameters('loadTestName'), ' Load Test')]": "[parameters('artillery-environment')]" }, "properties": { "containers": [ { "name": "[variables('containerGroupName')]", "properties": { "image": "[parameters('image')]", "environmentVariables": [ { "name": "ARTILLERY_ENVIRONMENT", "value": "[parameters('artillery-environment')]" }, { "name": "ARTILLERYIO_FILE", "value": "[parameters('artillery-file')]" }, { "name": "AZ_STORAGE_ACCOUNT", "value": "[variables('storageAccountName')]" }, { "name": "AZ_STORAGE_KEY", "value": "[listkeys(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2019-04-01').keys[0].value]" }, { "name": "LOAD_TEST_NAME", "value": "[variables('containerGroupName')]" } ], "resources": { "requests": { "cpu": "[variables('cpuCores')]", "memoryInGb": "[variables('memoryInGb')]" } } } } ], "restartPolicy": "Never", "osType": "Linux" } } ], "outputs": { } }