Azure ContainerApp stuck at provisioning state for more than 90 minutes

Bharath 10 Reputation points
2023-07-04T14:39:51.9766667+00:00

I built a azure containerapp through a bicep script shortened form of script below

resource containerApp 'Microsoft.App/containerApps@2023-04-01-preview'  = {
  name: containerAppName
  location: location
  properties: {
    managedEnvironmentId: containerAppManagedEnvironment.id
    configuration: {
      activeRevisionsMode: 'Single'
      ingress: {
        external: true
        targetPort: 80
      }
    }
    template: {
      containers: [
        {
          name: 'my-app'
          command: []
          image: 'mcr.microsoft.com/azuredocs/aci-helloworld'
          resources: {
            cpu: json('0.25')
            memory: '.5Gi'
          }
        }
      ]
    }
  }
}
The containerApp provisions properly. Now i try to update the containerApp with my application image. The image is in a private azure registry, i can update the image with docker commands. I I create a system managed identity for the containerapp and assign azrpull role to that.

use this command to create role assignment: az role assignment create

use this command to set registry: az containerapp registry set

Then use this command to update the container app from private registry which has admin access disabled

az containerapp update --name my-containerapp --resource-group my-rg --set-env-vars REDIRECT_URL=https://app-new.salmonbush-exyzeses.eastus.azurecontainerapps.io

//The redirect url is the same original url

The below is the docker file used for building the image where i have exposed 5173:

FROM node:16-alpine as build

WORKDIR /app
COPY . .
RUN npm ci
RUN npm audit fix
RUN npm run build


FROM node:16-alpine
WORKDIR /app
COPY --from=build /app/package*.json ./ 
RUN npm ci --omit-dev --ignore-scripts
RUN npm audit fix
COPY --from=build /app/build ./build

EXPOSE 5173
USER node
ENV PORT=5173
CMD ["node", "./build/index.js"]

The new revision lies in provisioning state for more 30 minutes with traffic showing 100% . it never successfully provisions. The system logs do not give any information showing error.

containerapp_revision

revsion_logs

I am not sure why the containerApp update fails. Can anyone help me here?

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

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,606 Reputation points Microsoft Employee
    2023-07-06T20:59:16.5866667+00:00

    @Bharath Your application is running on port 5173 but the targetPort in your bicep template is 80. This is likely why your container is stuck in provisioning.

    Note that your container will always be exposed via port 443 for HTTP(S) Ingress. So this setting is just for the port that your container listens on.

    Refer to the ingress docs for more information.

    0 comments No comments