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:
You can, but currently you can only do it with an Azure Resource Manager template. The CLI and the portal are both oriented towards the simple case: one container in the container group, and one exposed port in that container.
Here's an example resources section from an Azure Resource Manager template (see full template):
"resources": [
{
"name": "myContainerGroup",
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2017-08-01-preview",
"location": "[resourceGroup().location]",
"properties": {
"containers": [
{
"name": "myContainer",
"properties": {
"image": "seanmckenna/aci-helloworld-multiport",
"ports": [
{
"port": "80"
},
{
"port": "443"
}
],
"resources": {
"requests": {
"cpu": "1.0",
"memoryInGb": "1.5"
}
}
}
}
],
"osType": "Linux",
"ipAddress": {
"type": "Public",
"ports": [
{
"protocol": "tcp",
"port": "80"
},
{
"protocol": "tcp",
"port": "443"
}
]
}
}
}
]
You can deploy the template using az group deployment create
(full documentation):
az group deployment create -n myDeployment --template-file azuredeploy.json --parameters @azuredeploy.parameters.json -g myResourceGroup