Skip to content

Instantly share code, notes, and snippets.

@janakiramm
Last active August 26, 2017 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janakiramm/78a7af86ba6b8a71b15a86746a0082a0 to your computer and use it in GitHub Desktop.
Save janakiramm/78a7af86ba6b8a71b15a86746a0082a0 to your computer and use it in GitHub Desktop.
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