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.
I am not sure why the containerApp update fails. Can anyone help me here?