You can, but currently you can only do this with the Azure Resource Manager template. The CLI and the portal are focused on a simple case: one container in a group of containers and one open port in this container.
Here is an example of a resource 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
Sean McKenna - MSFT
source share