问题
I've been following this tutorial on how to deploy a NodeJS app to Azure:
https://www.youtube.com/watch?v=RWdxkhajCg0&fbclid=IwAR10Q6x8PbqLDAZZzzMX9Nvp_jEGiN_Ts4V8XLJbzF6xreq6_MB_vsbIqx8
Firstly, I did everything exactly the same way as the author showed and it all worked. In the video, they're using Linux Web App Service. Since I have to get familiar with the Windows App Services (that's what I am required to learn and use for my job), I decided to deploy exactly same app to the Windows Web App service. However, instead of the home page, I only saw "You do not have permission to view this directory or page.".
I've already read bunch of solutions online, people suggest adding a web.config file, but it didn't help no matter what I added to that. The app is not supposed to limit any ip addresses/user groups as it's supposed to be a newly deployed app with no access restrictions (just as in the tutorial).
The only hint that I found out is that on Linux it works, on Windows it doesn't.
The app code is here:
https://github.com/Aitemir/MSP005
回答1:
Because you uploaded the code to GitHub
, my answer will help you very well. Jay's solution should also be effective, but he uses DevOps
. If you are interested, you can also study.
Using Github
to deploy web app
will be very convenient.
Steps to solve my problem:
- Download your source code and upload it to my Github.
- Create a web app.
- Use continuous deployment.
- Delete
.yml
file. Delete all file in this folder.
- View deployment status.
When you follow my way, you will successfully deploy your application. You can also put the generated web.config file in the current application in kudu, which should solve your problem.
来源:https://stackoverflow.com/questions/64071999/node-js-deployment-to-azure-web-app-service-error-you-do-not-have-permission