I've got a bit of experience with Docker images. But I'm quite new to Azure Container Instances. So I've tried to push an image of my own. That was successful. But it kept restarting. So to better understand the situation, I thought it be better to start with the tutorial image.
I've followed these tutorials:
https://learn.microsoft.com/en-us/azure/container-instances/container-instances-tutorial-deploy-app
I'm using a managed identity according to this document:
https://learn.microsoft.com/en-us/azure/container-instances/using-azure-container-registry-mi
The image is available.
az acr repository show --name mycontainerregister --repository "aci-tutorial-app"
{
"changeableAttributes": {
"deleteEnabled": true,
"listEnabled": true,
"readEnabled": true,
"writeEnabled": true
},
"createdTime": "2025-02-10T09:47:17.9047564Z",
"imageName": "aci-tutorial-app",
"lastUpdateTime": "2025-02-10T09:47:17.9640607Z",
"manifestCount": 1,
"registry": "mycontainerregister.azurecr.io",
"tagCount": 1
}
After trying a lot of different options I got it successfully running:
az container create --name aci-tutorial-app --resource-group MyRG --image mycontainerregister.azurecr.io/aci-tutorial-app --cpu 1 --memory 1 --acr-identity $USERID --assign-identity $USERID --ports 80 --os-type Linux --ip-address Public --dns-name-label aci-tutorial-appmjk2025
{
"confidentialComputeProperties": null,
"containerGroupProfile": null,
"containers": [
{
"command": null,
"configMap": {
"keyValuePairs": {}
},
"environmentVariables": [],
"image": "mycontainerregister.azurecr.io/aci-tutorial-app",
"instanceView": {
"currentState": {
"detailStatus": "CrashLoopBackOff: Back-off restarting failed",
"exitCode": null,
"finishTime": null,
"startTime": null,
"state": "Waiting"
},
"events": [
{
"count": 1,
"firstTimestamp": "2025-02-10T21:50:03+00:00",
"lastTimestamp": "2025-02-10T21:50:03+00:00",
"message": "pulling image \"mycontainerregister.azurecr.io/aci-tutorial-app:latest\"",
"name": "Pulling",
"type": "Normal"
},
{
"count": 1,
"firstTimestamp": "2025-02-10T21:50:14+00:00",
"lastTimestamp": "2025-02-10T21:50:14+00:00",
"message": "Successfully pulled image \"mycontainerregister.azurecr.io/aci-tutorial-app:latest\"",
"name": "Pulled",
"type": "Normal"
},
{
"count": 2,
"firstTimestamp": "2025-02-10T21:50:25+00:00",
"lastTimestamp": "2025-02-10T21:50:41+00:00",
"message": "Started container",
"name": "Started",
"type": "Normal"
},
{
"count": 1,
"firstTimestamp": "2025-02-10T21:50:29+00:00",
"lastTimestamp": "2025-02-10T21:50:29+00:00",
"message": "Container aci-tutorial-app terminated with ExitCode 1.",
"name": "Killing",
"type": "Normal"
}
],
"previousState": {
"detailStatus": "Error",
"exitCode": 1,
"finishTime": "2025-02-10T21:50:47.808000+00:00",
"startTime": "2025-02-10T21:50:41.629000+00:00",
"state": "Terminated"
},
"restartCount": 1
},
"livenessProbe": null,
"name": "aci-tutorial-app",
"ports": [
{
"port": 80,
"protocol": "TCP"
}
],
"readinessProbe": null,
"resources": {
"limits": null,
"requests": {
"cpu": 1.0,
"gpu": null,
"memoryInGb": 1.0
}
},
"securityContext": null,
"volumeMounts": null
}
],
"diagnostics": null,
"dnsConfig": null,
"encryptionProperties": null,
"extensions": null,
"id": "/subscriptions/123d456g-9876-12d0-2109-a12345bc6789/resourceGroups/MyRG/providers/Microsoft.ContainerInstance/containerGroups/aci-tutorial-app",
"identity": {
"principalId": null,
"tenantId": "c2d1596d-9adc-4307-9ecc-36c6808a6859",
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/123d456g-9876-12d0-2109-a12345bc6789/resourcegroups/MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cvgen_ident": {
"clientId": "0c6146e4-4fcf-494f-8905-34f5ab7e47e6",
"principalId": "7cb5b409-2b9c-4d70-8c5d-c6296ec146fe"
}
}
},
"imageRegistryCredentials": [
{
"identity": "/subscriptions/123d456g-9876-12d0-2109-a12345bc6789/resourcegroups/MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cvgen_ident",
"identityUrl": null,
"isDelegatedIdentity": false,
"password": null,
"server": "mycontainerregister.azurecr.io",
"username": null
}
],
"initContainers": [],
"instanceView": {
"events": [],
"state": "Running"
},
"ipAddress": {
"autoGeneratedDomainNameLabelScope": "Unsecure",
"dnsNameLabel": "aci-tutorial-appmjk2025",
"fqdn": "aci-tutorial-appmjk2025.westeurope.azurecontainer.io",
"ip": "108.141.10.157",
"ports": [
{
"port": 80,
"protocol": "TCP"
}
],
"type": "Public"
},
"isCreatedFromStandbyPool": false,
"location": "westeurope",
"name": "aci-tutorial-app",
"osType": "Linux",
"priority": null,
"provisioningState": "Succeeded",
"resourceGroup": "MyRG",
"restartPolicy": null,
"sku": "Standard",
"standbyPoolProfile": null,
"subnetIds": null,
"tags": {},
"type": "Microsoft.ContainerInstance/containerGroups",
"volumes": null,
"zones": null
}
The Azure Portal says it's Running, but also that it has been Killed and Restarted numerous times. The logs page says "No Logs Available".
What could I be missing? I've already spent so many hours to get this working. I sort of expected this to be a tiny bit easier.