Container Apps bicep deployment - Turn off HTTP Ingress

Sam Scott 11 Reputation points
2022-06-23T13:08:48.22+00:00

When deploying a container app via a Bicep template, is there any way we can turn HTTP Ingress off? We have a background worker built with .NET that doesn't listen to any HTTP requests, so to keep the replica running we need to turn HTTP ingress off so that it doesn't keep failing the health checks.

https://stackoverflow.com/a/72411172/3692088

What we've got at the moment:

resource nonHttpContainerApp 'Microsoft.App/containerApps@2022-03-01' = {  
  name: containerAppName  
  location: location  
  properties: {  
    configuration: {  
      activeRevisionsMode: 'single'  
      ingress: {  
        allowInsecure: false  
        external: false  
        targetPort: 1 // validation fails if null  
      }  
      dapr: {  
        enabled: false  
      }  
      registries: [  
        {  
          passwordSecretRef: 'registrypassword'  
          server: registryServer  
          username: registryUsername  
        }  
      ]  
      secrets: [  
        {  
          name: 'registrypassword'  
          value: registryPassword  
        }  
      ]  
    }  
    managedEnvironmentId: environment.id  
    template: {  
      containers: containers  
      scale: {  
        maxReplicas: 1  
        minReplicas: 1  
      }  
    }  
  }  
}  

(excuse the wrong tag, couldn't find one specific to ACA)

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
669 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
325 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Sam Scott 11 Reputation points
    2022-06-23T13:56:03.567+00:00

    Nevermind, found the answer myself - if you omit the ingress section completely it will be disabled (e.g. below template compared to OP above)

     resource nonHttpContainerApp 'Microsoft.App/containerApps@2022-03-01' = {  
       name: containerAppName  
       location: location  
       properties: {  
         configuration: {  
           activeRevisionsMode: 'single'  
           dapr: {  
             enabled: false  
           }  
           registries: [  
             {  
               passwordSecretRef: 'registrypassword'  
               server: registryServer  
               username: registryUsername  
             }  
           ]  
           secrets: [  
             {  
               name: 'registrypassword'  
               value: registryPassword  
             }  
           ]  
         }  
         managedEnvironmentId: environment.id  
         template: {  
           containers: containers  
           scale: {  
             maxReplicas: 1  
             minReplicas: 1  
           }  
         }  
       }  
     }
    
    1 person found this answer helpful.