Share via

How to deploy a pnpm monorepo on Azure App Service when workspace packages are not resolving?

Deepak Pandey 0 Reputation points
2026-06-01T17:37:28.12+00:00

Monorepo (pnpm + turborepo) Azure App Service pe deploy ho raha hai.

Error: ERR_PNPM_WORKSPACE_PKG_NOT_FOUND

"@voice-ai/database@workspace:*" is in dependencies but

no package named "@voice-ai/database" is present in the workspace.

Packages found in the workspace: @voice-ai/web

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


2 answers

Sort by: Most helpful
  1. Praneeth Maddali 10,025 Reputation points Microsoft External Staff Moderator
    2026-06-02T01:04:49.8733333+00:00

    Hi @Deepak Pandey

    Thanks for reaching out with the details — I understand you're hitting the ERR_PNPM_WORKSPACE_PKG_NOT_FOUND error when deploying your pnpm + Turborepo monorepo to Azure App Service. This is a fairly common issue with workspace dependencies

    Azure App Service’s build system (Oryx) often only sees the folder you deploy. When it runs pnpm install, it can’t resolve workspace packages like @voice-ai/database@workspace:* because the full monorepo structure isn’t present.

    Recommended Solution

    The cleanest approach is to pre-build your app and use pnpm deploy to create a self-contained production folder. This resolves all workspace dependencies into regular ones and gives you a clean node_modules ready for deployment

    Steps:

    1. In your CI pipeline (or locally), run.
         pnpm install --frozen-lockfile
         pnpm run build --filter=@voice-ai/web   # or turbo run build
      
    2. Create a production-ready package
         pnpm --filter=@voice-ai/web deploy --prod ./deploy-web
      
    3. Zip the contents of the ./deploy-web folder (make sure there’s no extra top-level folder inside the zip) and deploy it using ZIP Deploy.
    4. In your App Service Configuration > Application settings, add:
      • SCM_DO_BUILD_DURING_DEPLOYMENT = false
      • WEBSITE_RUN_FROM_PACKAGE = 1 (recommended for better performance)

    This method avoids most workspace and Oryx-related issues.

    Reference:

    https://learn.microsoft.com/en-us/azure/app-service/deploy-zip?tabs=cli
    User's image

    https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux

    https://learn.microsoft.com/en-us/azure/app-service/deploy-run-package

    User's image

    Kindly let us know if the above helps or you need further assistance on this issue.

     

    Please "upvote" if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-06-01T17:37:54.3466667+00:00

    The error indicates that the deployment environment is building the app in a way that doesn’t correctly include or resolve all workspace packages in the pnpm monorepo. On Azure App Service, this typically happens when using ZIP or package-based deployment and the build output or package structure doesn’t match what the platform expects.

    To make the workspace packages resolve correctly on Azure App Service:

    1. Build the app before packaging
      • Run the full build locally or in CI (for example with Turborepo) so that the deployable output contains all necessary files.
      • For Node.js apps, ensure all npm/pnpm build steps are completed and the final output is self-contained.
      • When creating the ZIP package for deployment, include only the built output and required runtime files, not the raw monorepo source.
    2. Create a valid ZIP package for App Service
      • From the root of the built app (the folder that contains the entry file such as index.js or the built web assets), create a ZIP without nesting an extra top-level folder.
      • For example:
             zip -r app.zip .
        
      • Ensure that the ZIP structure matches what App Service expects: the entry point and package.json (if needed) are at the root of the ZIP, not inside additional nested directories.
    3. Avoid unsupported package layouts
      • If using a build system that produces nested or MSBuild-style packages, adjust it to output a folder-based structure that can be zipped directly.
      • If the package format is incompatible with ZIP deploy, use the Azure App Service deploy task with Web Deploy or restructure the build to produce a flat folder output.
    4. Use Azure Pipelines deployment tasks correctly (if using CI/CD)
      • In Azure Pipelines, ensure the build stage publishes the correct artifact (the built app folder or ZIP) and the release/deploy stage points to that artifact.
      • If using AzureWebApp@1 or AzureRmWebAppDeployment, set the package input to the correct path of the built app.
    5. Troubleshoot dependency issues
      • If the build fails due to dependency resolution, inspect the Node/npm output logs to identify malformed package.json or incompatible packages.
      • Fix any package.json issues locally, rebuild, and redeploy.

    These steps ensure that the deployed package contains a consistent, self-contained build where pnpm workspace packages are already resolved, avoiding runtime workspace resolution errors on Azure App Service.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.