Logic App Container Group: how enable Ingress in container app deployed within container group?

Leonard Bernstein 85 Reputation points
2025-05-02T12:09:23.2966667+00:00

Question about how to enable Ingress in a container app deployed within a container group?

We are trying to create a container group with a container app inside. We have a container app running (for testing), and it is running just fine. We want to have better control over the app - stop, start via Logic app, etc. For this to happen, we need to create a container group.

We created a script that successfully deploys the group and app. However, our container app within the container group seems to be starting and being killed with an Exit code 134.

Our standalone container app has an Ingress setting enabled. I cannot find how to enable same when deploying container App within container Group.

Command for deployment:

first:

az group create --name rglbTestOmsContainer-DEV --location eastus

second:

az deployment group create --resource-group rgEnfusionOmsContainer-DEV --template-file azuredeploy-dev.json

this is my file azuredeploy-dev.json:

{

"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",

"contentVersion": "1.0.0.0",

"parameters": {

  "containerGroupName": {

    "type": "string",

    "defaultValue": "lbTestOmsContainerGroup-dev",

    "metadata": {

      "description": "lbTestOmsContainerGroup Container Group DEV."

    }

  },

  "imageRegistryLoginServer": {

    "type": "string",

    "defaultValue": "lbTestomsconnector20240514175752.azurecr.io",

    "metadata": {

      "description": "lbTestOmsContainerGroup image Registry Login Server."

    }

  },

  "imageRegistryUsername": {

    "type": "string",

    "defaultValue": "lbTestOMSConnector20240514175752",

    "metadata": {

      "description": "lbTestOmsContainerGroup image Registry User name."

    }

  },

  "imageRegistryPassword": {

    "type": "string",

    "defaultValue": "2dovY7rX8aq2JkwJ64q3/8no683ZME0p09LZqSod07+ACRBO7PFn",

    "metadata": {

      "description": "lbTestOmsContainerGroup image Registry Password."

    }

  }

},

"variables": {

  "container1name": "lbTestomsconnector",

  "container1image": "lbTestomsconnector20240514175752.azurecr.io/lbTestomsconnector:20250331185850"

},

"resources": [

  {

    "name": "[parameters('containerGroupName')]",

    "type": "Microsoft.ContainerInstance/containerGroups",

    "apiVersion": "2019-12-01",

    "location": "[resourceGroup().location]",

    "properties": {

      "containers": [

        {

          "name": "[variables('container1name')]",

          "properties": {

            "image": "[variables('container1image')]",

            "resources": {

              "requests": {

                "cpu": 1,

                "memoryInGb": 1.5

              }

            },

            "ports": [

              {

                "port": 80

              },

              {

                "port": 8080

              }

            ]

          }

        }

      ],

      "osType": "Linux",

      "ipAddress": {

        "type": "Public",

        "ports": [

          {

            "protocol": "tcp",

            "port": 80

          },

          {

            "protocol": "tcp",

            "port": 8080

          }

        ]

      },

      "imageRegistryCredentials": [

        {

            "server": "[parameters('imageRegistryLoginServer')]",

            "username": "[parameters('imageRegistryUsername')]",

            "password": "[parameters('imageRegistryPassword')]"

        }

      ]

    }

  }

],

"outputs": {

  "containerIPv4Address": {

    "type": "string",

    "value": "[reference(resourceId('Microsoft.ContainerInstance/containerGroups/', parameters('containerGroupName'))).ipAddress.ip]"

  }

}

}

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
625 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vinodh247 32,451 Reputation points MVP
    2025-05-03T16:18:07.24+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    Key Points to note:

    1. ACI via containerGroups do not use Ingress like Azure Container Apps. Instead, they expose public IP addresses directly using the ipAddress and ports settings (which you already have).
    2. Exit code 134 typically means your container is crashing due to a runtime error like a memory issue, segmentation fault, or abort from your application.
    3. Your ACI config seems correct for exposing the container publicly. But the crash is preventing it from being reachable.

    Fix Checklist:

    Ingress Exposure (Container Group)

    You already have:

    
    "ipAddress": {
      "type": "Public",
      "ports": [
        { "protocol": "tcp", "port": 80 },
        { "protocol": "tcp", "port": 8080 }
      ]
    }
    

    This is the correct way to expose a container in ACI. Once deployed, you should be able to access the app via the output IP and respective port (e.g., http://<containerIPv4Address>:8080).

    Common Reasons for Exit Code 134:

    Your app (inside the container) is not happy with the environment or is crashing.

    Missing environment variables or secrets.

    Port mismatch: container is exposing port 8080, but the app is listening on a different one.

    Container expects a specific startup file or config that is missing.

    Suggestions to Fix:

    1. Check container logs:
         
         az container logs --name <containerGroupName> --resource-group <resourceGroupName>
      
      This will show what caused the crash (often more informative than exit code alone).
    2. Use command override for debugging: Temporarily override the container's startup command to just keep it running:
         
         "command": ["/bin/sh", "-c", "sleep 3600"]
      
      This lets you exec into the container:
         
         az container exec --resource-group <rg> --name <containerGroupName> --exec-command "/bin/sh"
      
    3. Verify exposed ports match app’s listening port: If your app is listening on 8081 but you exposed 8080, it will not respond. Use:
         
         EXPOSE 8080
      

    CMD ["npm", "start"]

       
       Or whatever is appropriate in your container image.
       
    Note:
    
    If you want more builtin ingress control, scaling, authentication, or lifecycle management (start/stop), Azure Container Apps are a better fit. You can start/stop Container Apps via Logic Apps using REST or PowerShell actions.
    
    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.