question

BenStaples-2122 avatar image
0 Votes"
BenStaples-2122 asked prmanhas-MSFT commented

App Service persistent storage breaks docker container

I have an app service running a docker container from an Azure Container Registry.

The container starts successfully within 15 seconds and is ready to serve requests.

I want to enable persisted storage to allow all the container instances in the service to share a few files.
I am trying to use the application setting WEBSITES_ENABLE_APP_SERVICE_STORAGE, however when I enable this setting, the container times out and doesn't present any errors.

I get the following in the logs when enabling the setting:

 docker run -d -p 2641:3001 --name [service_name]_2_d9625e76 -e PORT=3001 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=true -e WEBSITE_SITE_NAME=[service_name] -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=[service_name].azurewebsites.net -e WEBSITE_INSTANCE_ID=962880a44b3c94xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1e1a66c48ac6b9 -e HTTP_LOGGING_ENABLED=1 [service_name].azurecr.io/[service_name]:latest
    
 2021-04-06T17:47:14.867Z INFO  - Initiating warmup request to container [service_name]_2_d9625e76 for site [service_name]
 2021-04-06T17:47:30.612Z INFO  - Waiting for response to warmup request for container [service_name]_2_d9625e76. Elapsed time = 15.7444228 sec
 ... lots of lines
 2021-04-06T17:56:52.574Z INFO  - Waiting for response to warmup request for container [service_name]_2_d9625e76. Elapsed time = 577.707016 sec
 2021-04-06T17:57:14.909Z ERROR - Container [service_name]_2_d9625e76 for site [service_name] did not start within expected time limit. Elapsed time = 600.041979 sec
 2021-04-06T17:57:14.916Z ERROR - Container [service_name]_2_d9625e76 didn't respond to HTTP pings on port: 3001, failing site start. See container logs for debugging.

The container is using the dockerfile below to build:

 FROM node:14-alpine
    
 WORKDIR /tmp
    
 RUN apk update && apk add --no-cache nmap dpkg bash && \
     echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
     echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \
     apk update && \
     apk add --no-cache \
       chromium \
       harfbuzz \
       "freetype>2.8" \
       ttf-freefont \
       nss
    
 ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
    
 WORKDIR /usr/app
    
 COPY --chown=node:node installs installs
    
 RUN dpkg --add-architecture amd64
    
 RUN dpkg -i /usr/app/installs/libre/DEBS/*.deb
    
 RUN rm -rf installs
    
 COPY --chown=node:node ./app/package.json .
    
 RUN rm -rf node_modules
    
 RUN mkdir /home/templates \
     && mkdir /home/public \
     && chown -R node:node /home/templates \
     && chown -R node:node /home/public
    
 RUN npm i puppeteer \
     # Add user so we don't need --no-sandbox.
     # same layer as npm install to keep re-chowned files from using up several hundred MBs more space
     && addgroup -S pptruser && adduser -S -D pptruser \
     && adduser pptruser pptruser \
     && adduser pptruser audio \
     && adduser pptruser video \
     && mkdir -p /home/pptruser/Downloads \
     && chown -R pptruser:pptruser /home/pptruser
    
 RUN npm install --arch=x64 --platform=linux sharp
    
 RUN npm i --only=prod --quiet
    
 COPY --chown=node:node ./app .
    
 RUN npm install pm2 -g
    
 USER node
    
 CMD ["pm2-runtime", "/usr/app/bin/www"]


I've even tried using this setting on another app service, one that doesn't write or read any files from the filesystem, this has exactly the same problem when enabling the persisted storage.

Is there any way to find out what is causing the failure?

azure-container-instances
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BenStaples-2122Apologies for the delay in response and all the inconvenience caused because of the issue.

I have reached out to our internal team on this and will keep you posted once I have an update.

Thanks

0 Votes 0 ·

@BenStaples-2122 Any updates on the issue?

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

Thanks


0 Votes 0 ·

1 Answer

prmanhas-MSFT avatar image
0 Votes"
prmanhas-MSFT answered prmanhas-MSFT commented

@BenStaples-2122 It looks like you’re missing the step where you tell the App Service which Azure File share to use, as noted here.


Long story short, there’s a need to tell the app services which path to mount the Files into, etc.

Hope it helps!!!

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.







· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, one question that I can't find an answer to, when storage is shared between container instances, is storage still kept separate for different app services on the same App Service Plan?

0 Votes 0 ·