{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"projectName": {
"type": "string",
"metadata": {
"description": "Specify a project name that is used for generating resource names."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Specify the resource location."
}
},
"containerImage": {
"type": "string",
"defaultValue": "mcr.microsoft.com/azuredeploymentscripts-powershell:az9.7",
"metadata": {
"description": "Specify the container image."
}
},
"mountPath": {
"type": "string",
"defaultValue": "/mnt/azscripts/azscriptinput",
"metadata": {
"description": "Specify the mount path."
}
}
},
"variables": {
"storageAccountName": "[toLower(format('{0}store', parameters('projectName')))]",
"fileShareName": "[format('{0}share', parameters('projectName'))]",
"containerGroupName": "[format('{0}cg', parameters('projectName'))]",
"containerName": "[format('{0}container', parameters('projectName'))]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2023-01-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
},
"kind": "StorageV2",
"properties": {
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"apiVersion": "2023-01-01",
"name": "[format('{0}/default/{1}', variables('storageAccountName'), variables('fileShareName'))]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
},
{
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2023-05-01",
"name": "[variables('containerGroupName')]",
"location": "[parameters('location')]",
"properties": {
"containers": [
{
"name": "[variables('containerName')]",
"properties": {
"image": "[parameters('containerImage')]",
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": "[json('1.5')]"
}
},
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"volumeMounts": [
{
"name": "filesharevolume",
"mountPath": "[parameters('mountPath')]"
}
],
"command": [
"/bin/sh",
"-c",
"pwsh -c 'Start-Sleep -Seconds 1800'"
]
}
}
],
"osType": "Linux",
"volumes": [
{
"name": "filesharevolume",
"azureFile": {
"readOnly": false,
"shareName": "[variables('fileShareName')]",
"storageAccountName": "[variables('storageAccountName')]",
"storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2023-01-01').keys[0].value]"
}
}
]
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
}
]
}