Is it possible to expose/open more than one port on an Azure Container Instance? I\'ve only been able to open one port per container.
I\'d like to run the equivalent of:
Since ports
( indicated by []
) property is an array you can add more elements to it:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string",
"defaultValue": "acilinuxpublicipcontainergroup"
},
"image": {
"type": "string",
"defaultValue": "microsoft/aci-helloworld"
},
"port": {
"type": "string",
"defaultValue": "80"
},
"cpuCores": {
"type": "string",
"defaultValue": "1.0"
},
"memoryInGb": {
"type": "string",
"defaultValue": "1.5"
}
},
"resources": [
{
"name": "[parameters('name')]",
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2017-08-01-preview",
"location": "[resourceGroup().location]",
"properties": {
"containers": [
{
"name": "[parameters('name')]",
"properties": {
"image": "[parameters('image')]",
"ports": [
{
"port": "[parameters('port')]"
}
],
"resources": {
"requests": {
"cpu": "[parameters('cpuCores')]",
"memoryInGb": "[parameters('memoryInGb')]"
}
}
}
}
],
"osType": "Linux",
"ipAddress": {
"type": "Public",
"ports": [
{
"protocol": "tcp",
"port": "[parameters('port')]"
},
{
"protocol": "tcp",
"port": "[parameters('port2')]"
}
]
}
}
}
]
}
https://github.com/Azure/azure-quickstart-templates/tree/master/101-aci-linuxcontainer-public-ip
Deploy template:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-create-first-template#deploy-template