Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ARM Template to Deploy ACI Container
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
"containerName": "",
"containerImage": "",
"imageRegistryLoginServer":"",
"imageRegistryUsername":"",
"imageRegistryPassword":"",
"dbConnectionString" : ""
},
"resources": [
{
"name": "todo",
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2017-08-01-preview",
"location": "[resourceGroup().location]",
"properties": {
"containers": [
{
"name": "[variables('containerName')]",
"properties": {
"image": "[variables('containerImage')]",
"environmentVariables": [
{ "name": "DB", "value":"[variables('dbConnectionString')]" },
{ "name": "PORT", "value":"80"}
],
"resources":{
"requests": {
"cpu": 1,
"memoryInGb": 1.5
}
},
"ports": [
{
"port": 80
}
]
}
},
],
"osType": "Linux",
"imageRegistryCredentials": [{
"server": "[variables('imageRegistryLoginServer')]",
"username": "[variables('imageRegistryUsername')]",
"password": "[variables('imageRegistryPassword')]"
}],
"ipAddress": {
"type": "Public",
"ports": [
{
"protocol": "tcp",
"port": "80"
}
]
}
}
}
],
"outputs": {
"containerIPv4Address": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ContainerInstance/containerGroups/', 'todoGroup')).ipAddress.ip]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment