Created
June 13, 2019 20:53
-
-
Save Satak/4f5a836377b1093f5720cd31ba4293da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"containerName": { | |
"type": "string" | |
}, | |
"dnsNameLabel": { | |
"type": "string" | |
}, | |
"imageName": { | |
"type": "string", | |
"metadata": { | |
"description": "Container image to deploy. Should be of the form accountName/imagename:tag for images stored in Docker Hub or a fully qualified URI for a private registry like the Azure Container Registry." | |
}, | |
"defaultValue": "microsoft/aci-helloworld" | |
}, | |
"osType": { | |
"type": "string", | |
"defaultValue": "Linux", | |
"allowedValues": [ | |
"Linux", | |
"Windows" | |
] | |
}, | |
"numberCpuCores": { | |
"type": "int", | |
"defaultValue": 1 | |
}, | |
"memory": { | |
"type": "string", | |
"defaultValue": "1.5" | |
}, | |
"restartPolicy": { | |
"type": "string", | |
"defaultValue": "Always", | |
"allowedValues": [ | |
"OnFailure", | |
"Always", | |
"Never" | |
] | |
}, | |
"port": { | |
"type": "string", | |
"metadata": { | |
"description": "Port to open on the container and the public IP address." | |
}, | |
"defaultValue": "80" | |
} | |
}, | |
"resources": [ | |
{ | |
"location": "[resourceGroup().location]", | |
"name": "[parameters('containerName')]", | |
"type": "Microsoft.ContainerInstance/containerGroups", | |
"apiVersion": "2018-10-01", | |
"properties": { | |
"containers": [ | |
{ | |
"name": "[parameters('containerName')]", | |
"properties": { | |
"image": "[parameters('imageName')]", | |
"resources": { | |
"requests": { | |
"cpu": "[parameters('numberCpuCores')]", | |
"memoryInGB": "[float(parameters('memory'))]" | |
} | |
}, | |
"ports": [ | |
{ | |
"protocol": "Tcp", | |
"port": "[parameters('port')]" | |
} | |
] | |
} | |
} | |
], | |
"restartPolicy": "[parameters('restartPolicy')]", | |
"osType": "[parameters('osType')]", | |
"ipAddress": { | |
"type": "Public", | |
"dnsNameLabel": "[parameters('dnsNameLabel')]", | |
"ports": [ | |
{ | |
"protocol": "Tcp", | |
"port": "[parameters('port')]" | |
} | |
] | |
} | |
} | |
} | |
], | |
"outputs": { | |
"containerIPv4Address": { | |
"type": "string", | |
"value": "[reference(resourceId('Microsoft.ContainerInstance/containerGroups/', parameters('containerName'))).ipAddress.ip]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment