How to fix azure deployment error : deployer = ms-azuretools-vscode deploymentPath

123 Views Asked by At

I am gonna deploying react app by vscode. I clicked "Deploy to Web app" in left side of vscode with build folder this is the logs

5:01:32 PM  ...: Starting deployment...
5:01:32 PM  ...: Creating zip package...
5:01:32 PM  ...: Ignoring files from "appService.zipIgnorePattern"

5:01:35 PM  ...: Zip package size: 1.13 MB
5:02:39 PM  ...: Updating submodules.
5:02:40 PM  ...: Preparing deployment for commit id 'cad75485-9'.
5:02:41 PM  ...: PreDeployment: context.CleanOutputPath False
5:02:41 PM  ...: PreDeployment: context.OutputPath /home/site/wwwroot
5:02:41 PM  ...: Repository path is /tmp/zipdeploy/extracted
5:02:41 PM  ...: Running oryx build...
5:02:41 PM  ...: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 18 -p virtualenv_name= --log-file /tmp/build-debug.log  -i /tmp/8dc30e67918615e -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log

5:02:42 PM  ...: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
5:02:42 PM  ...: You can report issues at https://github.com/Microsoft/Oryx/issues
5:02:42 PM  ...: Oryx Version: 0.2.20230508.1, Commit: 7fe2bf39b357dd68572b438a85ca50b5ecfb4592, ReleaseTagName: 20230508.1
5:02:42 PM  ...: Build Operation ID: 28fd5fa4b3e873ef

5:02:42 PM  ...: Repository Commit : cad75485-9378-4882-bd22-0dfb357bf052
5:02:42 PM  ...: OS Type           : bullseye
5:02:42 PM  ...: Image Type        : githubactions
5:02:42 PM  ...: Detecting platforms...
5:02:42 PM  ...: Could not detect any platform in the source directory.
5:02:43 PM  ...: Error: Couldn't detect a version for the platform 'nodejs' in the repo.
5:02:43 PM  ...: /bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 18 -p virtualenv_name= --log-file /tmp/build-debug.log  -i /tmp/8dc30e67918615e -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log ; exit $PIPESTATUS "
5:02:43 PM  ...: Generating summary of Oryx build
5:02:43 PM  ...: Parsing the build logs
5:02:44 PM  ...: Found 0 issue(s)
5:02:44 PM  ...: Build Summary :
5:02:44 PM  ...: ===============
5:02:44 PM  ...: Errors (0)
5:02:44 PM  ...: Warnings (0)
5:02:45 PM  ...: Deployment Failed. deployer = ms-azuretools-vscode deploymentPath = ZipDeploy. Extract zip. Remote build.
5:03:22 PM  ...: Deployment failed

.

please help me.

My azure configration is like this:

1

There are 1 best solutions below

0
Pavan On

Error: Couldn't detect a version for the platform 'nodejs' in the repo.

The above error indicates there is node version not specified in the repository. check the node configuration in package.json and package-lock.json. check below:

package.json:

{
  "name": "my-react-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "engines": {
    "node": "14.x"
  }
}

update the version of Oryx being used in your deployment process. Newer versions might have bug fixes or improved compatibility.

I have created sample react application by using below commands.

npm install -g create-react-app
npx create-react-app my-react-app
cd my-react-app
npm start

The react application runs successfully by using npm start command.

enter image description here enter image description here

By running npm run build command build folder is created in the project directory.

I have selected the only build folder of react application and then deployed successfully into azure web app service. check below:

enter image description here

My application deployment workflow in the below:

10:42:24 AM hireact: Starting deployment...
10:42:24 AM hireact: Creating zip package...
10:42:26 AM hireact: Zip package size: 188 kB
10:42:27 AM hireact: Updating submodules.
10:42:27 AM hireact: Preparing deployment for commit id '28efa3aeb7'.
10:42:28 AM hireact: Generating deployment script.
10:42:28 AM hireact: Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted"'.
10:42:29 AM hireact: AppInsightsAgent: Successfully loaded ETW
10:42:32 AM hireact: AppInsightsAgent ETWLogger Application Insights was started succesfully.
10:42:32 AM hireact: Generating deployment script for Web Site
10:42:32 AM hireact: Generated deployment script files
10:42:33 AM hireact: Running deployment command...
10:42:33 AM hireact: Command: "C:\home\site\deployments\tools\deploy.cmd"
10:42:33 AM hireact: Handling Basic Web Site deployment.
10:42:34 AM hireact: Creating app_offline.htm
10:42:34 AM hireact: KuduSync.NET from: 'C:\local\Temp\zipdeploy\extracted' to: 'C:\home\site\wwwroot'
10:42:34 AM hireact: Deleting file: 'hostingstart.html'
10:42:34 AM hireact: Copying file: 'asset-manifest.json'
10:42:34 AM hireact: Copying file: 'favicon.ico'
10:42:34 AM hireact: Copying file: 'index.html'
10:42:34 AM hireact: Copying file: 'logo192.png'
10:42:34 AM hireact: Copying file: 'logo512.png'
10:42:34 AM hireact: Copying file: 'manifest.json'
10:42:34 AM hireact: Copying file: 'robots.txt'
10:42:34 AM hireact: Copying file: 'static\css\main.f855e6bc.css'
10:42:34 AM hireact: Copying file: 'static\css\main.f855e6bc.css.map'
10:42:35 AM hireact: Copying file: 'static\js\453.ad6eb26e.chunk.js'
10:42:35 AM hireact: Copying file: 'static\js\453.ad6eb26e.chunk.js.map'
10:42:35 AM hireact: Copying file: 'static\js\main.1130187e.js'
10:42:35 AM hireact: Copying file: 'static\js\main.1130187e.js.LICENSE.txt'
10:42:35 AM hireact: Copying file: 'static\js\main.1130187e.js.map'
10:42:35 AM hireact: Copying file: 'static\media\logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg'
10:42:35 AM hireact: Deleting app_offline.htm
10:42:35 AM hireact: Finished successfully.
10:42:40 AM: Deployment to "hireact" completed.

enter image description here

Output:

enter image description here