ms-azuretools-vscode ZipDeploy of production distribution causes Oryx errors

Chandan Datta 0 Reputation points
2025-01-15T05:48:52.0666667+00:00

I am trying to deploy a frontend app to azure app service. When I try to push a zip deploy output of a dist build(using rpm run build) from vscode to nodes runtime azure app service, I get an error below and the app service container stopping in the logs. What is causing this as I am not trying to ask the runtime to build the code(so kudu should just deploy it), although in vscode output it shows the app has been deployed successfully?

Error: Couldn't detect a version for the platform

'nodejs' in the repo.

The app service oryx run command is as follows:

oryx build /tmp/zipdeploy/extracted -0 /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.10g

-i /tmp/8ds3116e54a3b6 -p compress_node_modules-tar-gz | tee /tmp/oryx-build. 10g

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,180 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,046 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 1,755 Reputation points Microsoft Vendor
    2025-01-15T08:37:42.75+00:00

    Hi @Chandan Datta
    Thanks for the question and using MS Q&A platform.
    apologize for any inconvenience caused on this.
    The error message Error: Couldn't detect a version for the platform typically indicates that the Oryx build process is unable to identify the Node.js version specified for your application. This can happen if the package.json file is missing or if it does not specify a valid Node.js version.

    To resolve this issue, ensure that your package.json file is correctly configured and includes a valid engines field that specifies the Node.js version.
    1.Set Node.js Version:

    Set the WEBSITE_NODE_DEFAULT_VERSION app setting to a stable version (like 16.x) using the Azure CLI:

    az webapp config appsettings set --name <app-name> --resource-group <resource-group-name> --settings WEBSITE_NODE_DEFAULT_VERSION="16"
    
    

    2.Ensure All Dependencies Are Included:

    If using TypeScript or other build tools, ensure that all necessary compiled files are included in your deployment package.
    references:
    https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-windows#troubleshooting
    https://learn.microsoft.com/en-us/azure/static-web-apps/troubleshooting#retrieve-deployment-error-messages


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.