Azure App Service (Linux): Kudu absoluteTar.sh excludes .prisma (any folder starting with ".") from node_modules during Zip Deploy

Syed Junaid 0 Reputation points
2025-05-15T22:42:05.0266667+00:00

I'm deploying a Next.js app using Prisma ORM to Azure App Service (Linux) using Zip Deploy via the Azure CLI:

az webapp deployment source config-zip --resource-group <your-resource-group> --name <your-app-name> --src ./package.zip

πŸ” Issue

After deployment, the Prisma client fails to run because the .prisma/ folder is missing from node_modules/. This causes runtime errors when Prisma tries to load the client.

In the App Service Linux environment (via Kudu debug console), I found that the issue stems from this deployment step: /opt/Kudu/Scripts/absoluteTar.sh Which contains this command: cd node_modules tar -zcf ../node_modules.tar.gz *

Since * excludes hidden files like .prisma/, this results in Prisma client code being omitted from the deployed app β€” even though it exists before deployment.


βœ… What I’ve Verified

  • .prisma/ is present inside node_modules/ before packaging
  • The issue occurs only after deployment to App Service (Linux)
  • The problem is directly caused by the use of * in absoluteTar.sh, which excludes dotfolders
  • This behavior did not occur in earlier deployments β€” so it seems like a recent change

πŸ“¦ Environment Details

  • App Service OS: Linux (Node.js)
  • Kudu Version: 20250502.11
  • Kudu Commit: e32687b96fdab5e2f321f98f33b917df6606e460
  • Deploy Method: Zip Deploy via az webapp deployment source config-zip

❓My Questions

  1. When was this change introduced to use tar -zcf ... * in absoluteTar.sh?
  2. Why was * used, knowing it excludes dotfiles like .prisma/?
  3. Is this an intentional change to Kudu or the App Service Linux deployment container?
  4. Where can I find release notes or a changelog that tracks these internal container/Kudu updates?
  5. What is the recommended solution? Should I:
    • Add a startup.sh that manually extracts a correct tarball?
    • Run npx prisma generate at container start?

Thanks in advance for clarification β€” this behavior change has broken previously working deployments and seems undocumented.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,961 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Syed Junaid 0 Reputation points
    2025-05-17T14:16:20.8133333+00:00

    Just to add, this can be solved (if you stick with app service), by creating a custom startup script where you run the command which adds certain hidden folders to node_modules.

    For example, create a startup.sh file and add the following if you're using Prisma ORM.

    BashCopy

    
    # Generate Prisma client
    npx --yes prisma generate --schema database/prisma/schema.prisma
    
    # Start the server
    node server.js
    

    Then in your app service change the startup command to 'startup.sh', via Portal or any other means.

    This solves the issue.

    0 comments No comments

  2. Alekhya Vaddepally 1,670 Reputation points Microsoft External Staff Moderator
    2025-05-19T17:57:46.4833333+00:00

    Hi Syed Junaid,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    **
    Issue:
    Azure App Service (Linux): Kudu absoluteTar.sh excludes .prisma (any folder starting with ".") from node_modules during Zip Deploy

    Solution:

    Just to add, this can be solved (if you stick with app service), by creating a custom startup script where you run the command which adds certain hidden folders to node_modules.

    For example, create a startup.sh file and add the following if you're using Prisma ORM.

    
    # Generate Prisma client
    npx --yes prisma generate --schema database/prisma/schema.prisma
    
    # Start the server
    node server.js
    

    Then in your app service change the startup command to 'startup.sh', via Portal or any other means.

    This solves the issue.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


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.