Azure-Samples / nodejs-docs-hello-world

A simple nodejs application for docs
MIT License
407 stars 2.41k forks source link

"You do not have permission to view this directory or page." when app is deployed to Azure. #9

Closed TomSelleck101 closed 6 years ago

TomSelleck101 commented 6 years ago

Download project, runs locally fine with npm start. Compress files to zip, deploy to azure - "You do not have permission to view this directory or page." is displayed when you navigate to the web app.

Jaked222 commented 6 years ago

I have also seen this issue.

Alevale commented 6 years ago

This could be fixed if they merged https://github.com/Azure-Samples/nodejs-docs-hello-world/pull/7

davidkpiano commented 6 years ago

Copying-pasting #7's solution here for all others seeing this issue:

  1. Create a web.config file at the root of the app directory.
  2. Add the following code to web.config:
<configuration>
  <system.webServer>

    <!-- indicates that the index.js file is a node.js application 
    to be handled by the iisnode module -->

    <handlers>
      <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
    </handlers>

    <!-- adds index.js to the default document list to allow 
    URLs that only specify the application root location, 
    e.g. http://mysite.antarescloud.com/ -->

    <defaultDocument enabled="true">
      <files>
        <add value="index.js" />
      </files>
    </defaultDocument>

  </system.webServer>
</configuration>
Armin-FB commented 6 years ago

Hey, I'm having the same issue...I already created a web.config in the root of my project, just like explained here, but still I get "You do not have permission to view this directory or page".

the log of my deployment:

Command: bash deploy.sh
Handling node.js deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'angular.json'
Copying file: 'package-lock.json'
Copying file: 'package.json'
Copying file: 'web.config'
Invalid start-up command "ng serve" in package.json. Please use the format "node <script relative path>".
Looking for app.js/server.js under site root.
Missing server.js/app.js files, web.config is not generated
Node.js versions available on the platform are: 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32, 0.10.40, 0.12.0, 0.12.2, 0.12.3, 0.12.6, 4.0.0, 4.1.0, 4.1.2, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.3.0, 4.3.2, 4.4.0, 4.4.1, 4.4.6, 4.4.7, 4.5.0, 4.6.0, 4.6.1, 4.8.4, 5.0.0, 5.1.1, 5.3.0, 5.4.0, 5.5.0, 5.6.0, 5.7.0, 5.7.1, 5.8.0, 5.9.1, 6.0.0, 6.1.0, 6.2.2, 6.3.0, 6.5.0, 6.6.0, 6.7.0, 6.9.0, 6.9.1, 6.9.2, 6.9.4, 6.9.5, 6.10.0, 6.10.3, 6.11.1, 6.11.2, 6.11.5, 6.12.2, 6.12.3, 7.0.0, 7.1.0, 7.2.0, 7.3.0, 7.4.0, 7.5.0, 7.6.0, 7.7.0, 7.7.4, 7.10.0, 7.10.1, 8.0.0, 8.1.4, 8.4.0, 8.5.0, 8.7.0, 8.8.0, 8.8.1, 8.9.0, 8.9.3, 8.9.4, 8.10.0, 8.11.1, 10.0.0.
Selected node.js version 8.11.1. Use package.json file to choose a different version.
Selected npm version 5.6.0
Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml
Running "D:\Program Files (x86)\nodejs\8.11.1\node.exe" "D:\Program Files (x86)\npm\5.6.0\node_modules\npm\bin\npm-cli.js" install --production
up to date in 5.234s
Finished successfully.

any ideas? I'm struggling with it for really long now.

Alevale commented 6 years ago

Seems to me like you haven't really added it (Judging this line) or that you don't have a app.js or a server.js in your site root (the place from which MS will run the server)

Looking for app.js/server.js under site root.
Missing server.js/app.js files, web.config is not generated
Jaked222 commented 6 years ago

Also make sure you're viewing the proper directory of your service. I noticed that I wasn't navigating to the proper URL. Check out the structure of your files in the azure console. Go to site\wwwroot and see if the files are contained within a directory. This can happen from Zip deploy, as in my case. If they are, you'll want to try navigating to www..azurewebsites.net//

cephalin commented 6 years ago

I can't reproduce the error with zip deploy. Note that this repo is already updated with the required web.config.

COLTstreet commented 6 years ago

I'm still getting this same error with the tutorial @cephalin

Alevale commented 6 years ago

@COLTstreet you could try the solution #7, it did fix it for me... As stated above, copy the code of there into a web.config file and it should be resolved

COLTstreet commented 6 years ago

I did that. Still didn't fix it. @Alevale

Alevale commented 6 years ago

@COLTstreet sry man, good luck... MS docs suck quite a bit, and half their tutorials are broken :) NO pun intended :)

cephalin commented 6 years ago

@COLTstreet Can you please send your repo to me privately? cephalin@microsoft.com. I'd like to see why it doesn't work for you since the web.config is already in the latest repo.

COLTstreet commented 6 years ago

@cephalin I got the local git tutorial with Kudu working. If I have time I'll try the ZipDeploy again. I'm still fairly certain it won't work but we'll see.

jackharich commented 6 years ago

I'm getting this same error. Why doesn't the Azure deploy check for the correct configuration, and report the error right on the Visual Studio Code CLI, with a link to how to fix the problem? That kind of high usability would completely fix this problem.

jackharich commented 6 years ago

Why is this error appearing at all, if the server is a node.js app? The app will route the client request to the proper handler.

Alevale commented 6 years ago

@jackharich, the simplest thing you can do is switch to GAE, simple and easy to deploy in literally one command... And it just relies on having a npm start command and not the nonsense of the web.configthat works half of the time... Or the kudu hell

cephalin commented 6 years ago

@jackharich Do you get the error by following the quickstart? This repo is designed for that.

Zip deploy by default doesn't run Kudu. You can also try the Linux based quickstart, which does deploy with one simple az webapp up command. This command currently doens't support Node.js in Windows.

jackharich commented 6 years ago

Thanks, @cephalin, but I don't want to deploy from github using the dozens-of-steps procedure described in that quickstart. I'm using Visual Studio Code. In the Azure App Service panel, I right click on an App Service and choose Deploy to Web App. Then I select the preferred folder. Then I approve deployment.

This is wonderfully simple. I even had it working yesterday. Today it's not working. The xxxxx.azurewebsites.net site hangs for about 5 minutes and then says "Service Unavailable."

To try to solve the problem I created two new App Services today. Deploying to them results in the error this thread is discussing.

Sure would be nice if we had error logs inside Visual Studio Code for deployed apps, as we do for local dev. Then we would not have to work so incredibly hard to debug. Without error logs we are working in stone age conditions.

jackharich commented 6 years ago

@Alevale, thanks for the suggestion. I will look into Google App Engine.

I have tried Google Cloud and encountered errors and a mountain of complexity. I was also very put off by the google-cloud-sdk folder with its 22,000 files and addition of other files to the app root. This is heavy handed, and it errored out.

I was hoping to get Azure to work for node.js apps, due to Azure's better integration with Visual Studio Code. This includes someday soon we will be able to debug a remote app from within VSC.

jackharich commented 6 years ago

@cephalin, sorry I didn't read further. This is has been intensely frustrating, as after 12 days I've been unable to successfully deploy a test node app with a database.

"You can also try the Linux based quickstart, which does deploy with one simple az webapp up command. This command currently doens't support Node.js in Windows." I will try that. I'm using a linux server.

Thanks!

jackharich commented 6 years ago

@cephalin, thanks for your help. I gave the Linux based quickstart a try. Here are the results:

PS C:\AWork\PPKB\Gen2\Dev\test-quickstart> git clone https://github.com/Azure-Samples/nodejs-docs-hello-world Cloning into 'nodejs-docs-hello-world'... remote: Counting objects: 40, done. remote: Total 40 (delta 0), reused 0 (delta 0), pack-reused 40 Unpacking objects: 100% (40/40), done. PS C:\AWork\PPKB\Gen2\Dev\test-quickstart> cd .\nodejs-docs-hello-world\ PS C:\AWork\PPKB\Gen2\Dev\test-quickstart\nodejs-docs-hello-world> az webapp up -n test-quickstart az webapp: 'up' is not an az webapp command. See 'az webapp --help'.

PS C:\AWork\PPKB\Gen2\Dev\test-quickstart\nodejs-docs-hello-world> az extension update -n webapp The extension webapp is not installed.

PS C:\AWork\PPKB\Gen2\Dev\test-quickstart> az --version azure-cli (2.0.38)

So, 'up' doesn't work and I can't update az. I'm running on Powershell inside of VSC.

Reading the quickstart doc closely, it seems it muddles back and forth between TWO different CLIs. So I tried Azure Cloud Shell. Ugh. Looks very beta. Doesn't even support paste. How primitive can you get?!!!!!!!!!!!!!!!!!!!!!!!!! So I typed in 'az extension add -n webapp'. Here's the sad result:

Requesting a Cloud Shell. PowerShell may take up to a minute.Succeeded. Connecting terminal...

Welcome to Azure Cloud Shell (Preview)

Type "dir" to see your Azure resources Type "help" to learn about Cloud Shell

Changes coming to PowerShell: https://azure.microsoft.com/en-us/blog/pscloudshellrefresh/

VERBOSE: Authenticating to Azure ... VERBOSE: Building your Azure drive ... Azure:\ PS Azure:> az extension add -n webapp Traceback (most recent call last): File "runpy.py", line 193, in _run_module_as_main File "runpy.py", line 85, in _run_code File "C:\Users\trdai\AppData\Local\Temp\pip-install-89bq87q4\azure-cli\azure\cli__main.py", line 32, in File "C:\Users\trdai\AppData\Local\Temp\pip-install-89bq87q4\azure-cli-core\azure\cli\core\init.py", line 493, in get_defa ult_cli File "C:\Users\trdai\AppData\Local\Temp\pip-install-89bq87q4\azure-cli-core\azure\cli\core\init.py", line 49, in init__ File "C:\Users\trdai\AppData\Local\Temp\pip-install-89bq87q4\knack\knack\util.py", line 38, in ensure_dir File "os.py", line 210, in makedirs File "os.py", line 220, in makedirs FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\ContainerAdministrator\CloudDrive\.pscl oudshell'

My conclusion is all devs like me are doing here is working for free for MS to debug their apps. (&^%(P&IU(^%)(&)(P&

cephalin commented 6 years ago

Try the tutorial in the bash terminal of cloud shell instead. The PowerShell cloud shell is in preview still.

BTW, this is not the right place to debug your VSC errors.

jackharich commented 6 years ago

*"*The PowerShell cloud shell is in preview still."- Then why is that not made obvious? Why must I WASTE TONSD OF TIME WITH SOFTWARE THAT IS KNOWN TO BE BUGGY????????????????

*"*BTW, this is not the right place to debug your VSC errors."

Thanks. The errors I need to debug relate to inability to deploy. Why is the server hanging? And once I get past that, why is the database connecting in dev but not on production in Azure? There are reasons why devs desperately need deployment error logs.

On 6/25/2018 4:08 PM, Cephas Lin wrote:

Try the tutorial in the bash terminal of cloud shell instead. The PowerShell cloud shell is in preview still.

BTW, this is not the right place to debug your VSC errors.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure-Samples/nodejs-docs-hello-world/issues/9#issuecomment-400078789, or mute the thread https://github.com/notifications/unsubscribe-auth/Ag5NJbrMDIU81hpUXKRMYf7h3f_4vvV8ks5uAUMkgaJpZM4TDX4d.

Alevale commented 6 years ago

@cephalin i know this isn't the place to discuss MS prosuct details or an u anything, but, is there any way to get the azure deployment to be run like in GAE in one command google app deploy but without all of the added git complexity??

In my opinion, separation of concerns tought me that you shouldn't mix 2 things that are independant and deployment should not exclusively depend upon having a git hook or branch there.

If there was I'm sorry for asking but I just couldn't find it before

cephalin commented 6 years ago

@Alevale check out the same Linux Node.js quickstart, which shows the single az webapp up command (also in preview, sorry @jackharich) to create resources and deploy code - without git. It uses Zip upload instead.

Ethan-Arrowood commented 6 years ago

I've been running into errors following the quick start guide too. Using GIT deploy works much better. I recommend using that over zip deploy, https://docs.microsoft.com/en-us/azure/app-service/app-service-deploy-local-git

Ethan-Arrowood commented 6 years ago

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-nodejs

Followed this exactly. Ran into the You do not have permission to view this directory or page. error. FWIW I was using a microsoft intern account and a team azure subscription.

idiotleon commented 6 years ago

Literal follow up with the tutorial, but got the error "You do not have permission to view this directory or page.".

cephalin commented 6 years ago

@IdiotLeon Looks like you got your solution here

pcnate commented 5 years ago

azure app service just needs to make an option in the dropdown to select nodejs......

cephalin commented 5 years ago

@pcnate The Linux flavor in the portal already lets you choose the Node.js version you want. The Windows flavor comes with Node.js preinstalled and you can choose the version you want by following the quickstart, or if you don't choose it yourself then a default version is chosen for you.

pcnate commented 5 years ago

@cephalin it is just confusing. I hadn't even found the quick start until after I built a working Web App. I was simply trying to create another one that was deployed to with an Azure Devops Release Pipeline. The issue I was having when I found this thread was due to my Azure Devops Release Pipeline successfully deploying and everything but it wouldn't run. I could load the index.js in the browser but couldn't get it to be handled by iisnode. The web.config looked correct, all the files were there etc. Changed from an Azure App Service Deploy to an Azure Web App deployment. Takes longer but it works even though they both say it was successful

cephalin commented 5 years ago

@pcnate you're right that the App Service doc set doesn't have a quickstart specific to Azure Devops Release Pipeline. Azure DevOps does have a Node.js tutorial here similar to your particular scenario: https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/javascript?view=azure-devops&tabs=yaml. For any issues, I recommend bringing them to StackOverflow, etc.

yinxingyi commented 4 years ago

Copying-pasting #7's solution here for all others seeing this issue:

  1. Create a web.config file at the root of the app directory.
  2. Add the following code to web.config:
<configuration>
  <system.webServer>

    <!-- indicates that the index.js file is a node.js application 
    to be handled by the iisnode module -->

    <handlers>
      <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
    </handlers>

    <!-- adds index.js to the default document list to allow 
    URLs that only specify the application root location, 
    e.g. http://mysite.antarescloud.com/ -->

    <defaultDocument enabled="true">
      <files>
        <add value="index.js" />
      </files>
    </defaultDocument>

  </system.webServer>
</configuration>

You probably need change "index.js" to what initial js file name in your project. For my project I call it "app.js" so while I replaced all "index.js" to "app.js", it works!

norene9 commented 4 years ago

I replace index.js and i have an other issue the page shows me the code

codeshinobi commented 4 years ago

I replace index.js and i have an other issue the page shows me the code

HI. I have the same issue too. Not even the Azure Expert on support can fix that. They said they will investigate and get back to me. They still have not and it doesn't seem like this will get fixed. Why am I seeing Javascript code when I hit the url to my app? Is it not supposed to serve the NodeJs app after adding the above web.config?

norene9 commented 4 years ago

I replace index.js and i have an other issue the page shows me the code

HI. I have the same issue too. Not even the Azure Expert on support can fix that. They said they will investigate and get back to me. They still have not and it doesn't seem like this will get fixed. Why am I seeing Javascript code when I hit the url to my app? Is it not supposed to serve the NodeJs app after adding the above web.config?

I solved my issue it was because i added an http variable i remove it and everything becomes good

irfanjs commented 4 years ago

Hello, I am also facing the same issue. after reading all above posts , added the web.config file , but not sure what is the correct location of that .

here is the current folder structure: image

i have two places where web.config is there. which location is correct ? please suggest

below is the entire log of deployment

8:25:46 AM waappqa: Starting deployment... 8:25:47 AM waappqa: Creating zip package... 8:27:45 AM waappqa: Zip package size: 73.3 MB 8:27:47 AM waappqa: Fetching changes. 8:27:47 AM waappqa: Cleaning up temp folders from previous zip deployments and extracting pushed zip file C:\local\Temp\zipdeploy\qpba2szn.zip (69.87 MB) to C:\local\Temp\zipdeploy\extracted 8:30:03 AM waappqa: Updating submodules. 8:30:03 AM waappqa: Preparing deployment for commit id 'ce13c8a345'. 8:30:04 AM waappqa: Generating deployment script. 8:30:04 AM waappqa: 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"'. 8:30:06 AM waappqa: Generating deployment script for Web Site 8:30:06 AM waappqa: Running deployment command... 8:30:06 AM waappqa: Command: "C:\home\site\deployments\tools\deploy.cmd" 8:30:10 AM waappqa: Handling Basic Web Site deployment. 8:30:13 AM waappqa: Creating app_offline.htm 8:30:13 AM waappqa: KuduSync.NET from: 'C:\local\Temp\zipdeploy\extracted' to: 'C:\home\site\wwwroot' 8:30:13 AM waappqa: Deleting file: 'hostingstart.html' 8:30:13 AM waappqa: Copying file: '.gitignore' 8:30:13 AM waappqa: Copying file: 'package-lock.json' 8:30:13 AM waappqa: Copying file: 'package.json' 8:30:13 AM waappqa: Copying file: 'README.md' 8:30:13 AM waappqa: Copying file: '.vscode\settings.json' 8:30:13 AM waappqa: Copying file: 'build\asset-manifest.json' 8:30:13 AM waappqa: Copying file: 'build\favicon.ico' 8:30:13 AM waappqa: Copying file: 'build\index.html' 8:30:13 AM waappqa: Copying file: 'build\logo192.png' 8:30:13 AM waappqa: Copying file: 'build\logo512.png' 8:30:13 AM waappqa: Copying file: 'build\manifest.json' 8:30:13 AM waappqa: Copying file: 'build\precache-manifest.8e35258c32a154242f8848b4204d7975.js' 8:30:13 AM waappqa: Copying file: 'build\robots.txt' 8:30:13 AM waappqa: Copying file: 'build\service-worker.js' 8:30:13 AM waappqa: Copying file: 'build\static\css\2.af3c1da9.chunk.css' 8:30:13 AM waappqa: Copying file: 'build\static\css\2.af3c1da9.chunk.css.map' 8:30:13 AM waappqa: Copying file: 'build\static\css\main.b6cec78e.chunk.css' 8:30:13 AM waappqa: Copying file: 'build\static\css\main.b6cec78e.chunk.css.map' 8:30:13 AM waappqa: Copying file: 'build\static\js\2.4d4573af.chunk.js' 8:30:14 AM waappqa: Copying file: 'build\static\js\2.4d4573af.chunk.js.LICENSE.txt' 8:30:14 AM waappqa: Copying file: 'build\static\js\2.4d4573af.chunk.js.map' 8:30:14 AM waappqa: Copying file: 'build\static\js\main.ff2839ca.chunk.js' 8:30:14 AM waappqa: Copying file: 'build\static\js\main.ff2839ca.chunk.js.map' 8:30:14 AM waappqa: Copying file: 'build\static\js\runtime-main.05b044cc.js' 8:30:14 AM waappqa: Copying file: 'build\static\js\runtime-main.05b044cc.js.map' 8:30:14 AM waappqa: Copying file: 'build\static\media\img_bg_1.a44b82f9.jpg' 8:30:14 AM waappqa: Copying file: 'build\static\media\img_bg_2.aabaaf4f.jpg' 8:30:14 AM waappqa: Copying file: 'build\static\media\img_bg_3.06a26687.jpg' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\acorn' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\acorn.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\acorn.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\ansi-html' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\ansi-html.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\ansi-html.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\atob' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\atob.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\atob.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\autoprefixer' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\autoprefixer.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\autoprefixer.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\babylon' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\babylon.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\babylon.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\browserslist' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\browserslist.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\browserslist.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\css-blank-pseudo' 8:30:14 AM waappqa: Omitting next output lines... 8:30:34 AM waappqa: Processed 2158 files... 8:30:54 AM waappqa: Processed 4373 files... 8:31:14 AM waappqa: Processed 6304 files... 8:31:34 AM waappqa: Processed 8078 files... 8:31:54 AM waappqa: Processed 10228 files... 8:32:14 AM waappqa: Processed 12368 files... 8:32:34 AM waappqa: Processed 14424 files... 8:32:54 AM waappqa: Processed 16299 files... 8:33:14 AM waappqa: Processed 18203 files... 8:33:34 AM waappqa: Processed 20099 files... 8:33:54 AM waappqa: Processed 21759 files... 8:34:14 AM waappqa: Processed 23621 files... 8:34:34 AM waappqa: Processed 25492 files... 8:34:54 AM waappqa: Processed 26927 files... 8:35:14 AM waappqa: Processed 28501 files... 8:35:34 AM waappqa: Processed 30111 files... 8:35:54 AM waappqa: Processed 32080 files... 8:36:14 AM waappqa: Processed 34263 files... 8:36:34 AM waappqa: Processed 35878 files... 8:36:54 AM waappqa: Processed 37383 files... 8:37:06 AM waappqa: Finished successfully. 8:37:06 AM waappqa: Running post deployment command(s)... 8:37:06 AM waappqa: Triggering recycle (preview mode disabled). 8:37:06 AM waappqa: Deployment successful. 8:37:07 AM: Deployment to "waappqa" completed.

codeshinobi commented 4 years ago

Hello, I am also facing the same issue. after reading all above posts , added the web.config file , but not sure what is the correct location of that .

here is the current folder structure: image

i have two places where web.config is there. which location is correct ? please suggest

below is the entire log of deployment

8:25:46 AM waappqa: Starting deployment... 8:25:47 AM waappqa: Creating zip package... 8:27:45 AM waappqa: Zip package size: 73.3 MB 8:27:47 AM waappqa: Fetching changes. 8:27:47 AM waappqa: Cleaning up temp folders from previous zip deployments and extracting pushed zip file C:\local\Temp\zipdeploy\qpba2szn.zip (69.87 MB) to C:\local\Temp\zipdeploy\extracted 8:30:03 AM waappqa: Updating submodules. 8:30:03 AM waappqa: Preparing deployment for commit id 'ce13c8a345'. 8:30:04 AM waappqa: Generating deployment script. 8:30:04 AM waappqa: 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"'. 8:30:06 AM waappqa: Generating deployment script for Web Site 8:30:06 AM waappqa: Running deployment command... 8:30:06 AM waappqa: Command: "C:\home\site\deployments\tools\deploy.cmd" 8:30:10 AM waappqa: Handling Basic Web Site deployment. 8:30:13 AM waappqa: Creating app_offline.htm 8:30:13 AM waappqa: KuduSync.NET from: 'C:\local\Temp\zipdeploy\extracted' to: 'C:\home\site\wwwroot' 8:30:13 AM waappqa: Deleting file: 'hostingstart.html' 8:30:13 AM waappqa: Copying file: '.gitignore' 8:30:13 AM waappqa: Copying file: 'package-lock.json' 8:30:13 AM waappqa: Copying file: 'package.json' 8:30:13 AM waappqa: Copying file: 'README.md' 8:30:13 AM waappqa: Copying file: '.vscode\settings.json' 8:30:13 AM waappqa: Copying file: 'build\asset-manifest.json' 8:30:13 AM waappqa: Copying file: 'build\favicon.ico' 8:30:13 AM waappqa: Copying file: 'build\index.html' 8:30:13 AM waappqa: Copying file: 'build\logo192.png' 8:30:13 AM waappqa: Copying file: 'build\logo512.png' 8:30:13 AM waappqa: Copying file: 'build\manifest.json' 8:30:13 AM waappqa: Copying file: 'build\precache-manifest.8e35258c32a154242f8848b4204d7975.js' 8:30:13 AM waappqa: Copying file: 'build\robots.txt' 8:30:13 AM waappqa: Copying file: 'build\service-worker.js' 8:30:13 AM waappqa: Copying file: 'build\static\css\2.af3c1da9.chunk.css' 8:30:13 AM waappqa: Copying file: 'build\static\css\2.af3c1da9.chunk.css.map' 8:30:13 AM waappqa: Copying file: 'build\static\css\main.b6cec78e.chunk.css' 8:30:13 AM waappqa: Copying file: 'build\static\css\main.b6cec78e.chunk.css.map' 8:30:13 AM waappqa: Copying file: 'build\static\js\2.4d4573af.chunk.js' 8:30:14 AM waappqa: Copying file: 'build\static\js\2.4d4573af.chunk.js.LICENSE.txt' 8:30:14 AM waappqa: Copying file: 'build\static\js\2.4d4573af.chunk.js.map' 8:30:14 AM waappqa: Copying file: 'build\static\js\main.ff2839ca.chunk.js' 8:30:14 AM waappqa: Copying file: 'build\static\js\main.ff2839ca.chunk.js.map' 8:30:14 AM waappqa: Copying file: 'build\static\js\runtime-main.05b044cc.js' 8:30:14 AM waappqa: Copying file: 'build\static\js\runtime-main.05b044cc.js.map' 8:30:14 AM waappqa: Copying file: 'build\static\media\img_bg_1.a44b82f9.jpg' 8:30:14 AM waappqa: Copying file: 'build\static\media\img_bg_2.aabaaf4f.jpg' 8:30:14 AM waappqa: Copying file: 'build\static\media\img_bg_3.06a26687.jpg' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\acorn' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\acorn.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\acorn.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\ansi-html' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\ansi-html.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\ansi-html.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\atob' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\atob.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\atob.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\autoprefixer' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\autoprefixer.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\autoprefixer.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\babylon' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\babylon.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\babylon.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\browserslist' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\browserslist.cmd' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\browserslist.ps1' 8:30:14 AM waappqa: Copying file: 'node_modules.bin\css-blank-pseudo' 8:30:14 AM waappqa: Omitting next output lines... 8:30:34 AM waappqa: Processed 2158 files... 8:30:54 AM waappqa: Processed 4373 files... 8:31:14 AM waappqa: Processed 6304 files... 8:31:34 AM waappqa: Processed 8078 files... 8:31:54 AM waappqa: Processed 10228 files... 8:32:14 AM waappqa: Processed 12368 files... 8:32:34 AM waappqa: Processed 14424 files... 8:32:54 AM waappqa: Processed 16299 files... 8:33:14 AM waappqa: Processed 18203 files... 8:33:34 AM waappqa: Processed 20099 files... 8:33:54 AM waappqa: Processed 21759 files... 8:34:14 AM waappqa: Processed 23621 files... 8:34:34 AM waappqa: Processed 25492 files... 8:34:54 AM waappqa: Processed 26927 files... 8:35:14 AM waappqa: Processed 28501 files... 8:35:34 AM waappqa: Processed 30111 files... 8:35:54 AM waappqa: Processed 32080 files... 8:36:14 AM waappqa: Processed 34263 files... 8:36:34 AM waappqa: Processed 35878 files... 8:36:54 AM waappqa: Processed 37383 files... 8:37:06 AM waappqa: Finished successfully. 8:37:06 AM waappqa: Running post deployment command(s)... 8:37:06 AM waappqa: Triggering recycle (preview mode disabled). 8:37:06 AM waappqa: Deployment successful. 8:37:07 AM: Deployment to "waappqa" completed.

Hi

Please make sure you are serving the correct folder (which is the build folder and not your source folder). It should be something like wwwroot\build. Then you run "npm run build" in kudu (https://.scm.azurewebsites.net/)

irfanjs commented 4 years ago

sorry, did not understand fully. i do have the build folder and if i run the "npm run build" command , it works locally on my dev machine. DO you mean web.config should be part of build folder ? is that so ? can you please give some clear inputs. is the above folder structure looks fine ? Thanks

codeshinobi commented 4 years ago

Hi again

This is my final communication with Azure Support:

"I have managed to resolve this issue myself. I could not wsit. It was urgent and could not wait.

But basically, the document to point to is the index.html document (add index.js to be safe). And thereafter point the "/" route to the "build" folder. The App Services extensions deploys everything including source code. Just point to the build folder. Also, add the web.config (https://github.com/Azure-Samples/nodejs-docs-hello-world/issues/9) in the root of the app. This is for IIS hosted NodeJs apps."

irfanjs commented 4 years ago

Hi,

Sorry to say but i dont understand . i have created react app using create-react-app. further, index.html and index.js are at the right place . i have referred this . so why should we point the "/" route to the "build" folder. does Azure app service will not handle this automatically ?

the root web.config will have reference to the index.js file ? i mean do i have to change the path of index.js file ?

please suggest

irfanjs commented 4 years ago

happy to inform that , it is resolved. this link help me lot . https://medium.com/@to_pe/deploying-create-react-app-on-microsoft-azure-c0f6686a4321

ruifrvaz commented 4 years ago

I don't have index.js. My angular app defaults to index.html, so the solution that worked for me was adding this to the web.config:

<!-- sets the default document so root knows where to point to. Angular requires this -->
<defaultDocument enabled="true">
  <files>
    <add value="index.html" />
  </files>
</defaultDocument>