“您无权查看此目录或页面"Azure 中的错误 [英] "You do not have permission to view this directory or page" error in Azure
问题描述
我以前从未使用过 Azure,我遵循以下教程:
更多解决方案,请参考以下主题:
1.推送到Windows Azure后报错:您没有权限查看此目录或页面
2.https://github.com/Azure-Samples/nodejs-docs-hello-world/issues/9
希望对你有帮助,有什么问题请告诉我.
I have never used Azure before and I followed the following tutorial: https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-nodejs#create-a-project-zip-file
I am getting a permissions error when trying to deploy a simple app on Azure made in Node.js. I have tried reuploading multiple times but I get the same error every time. I am using a Free Trial of Azure.
Here is package.json and web.config
PACKAGE.JSON:
{
"name": "oslo-solutions",
"version": "1.0.0",
"description": "",
"main": "scripts.js",
"scripts": {
"test": "karma start karma.conf.js",
"build": "webpack --mode development",
"start": "webpack-dev-server --open",
"lint": "eslint src/*.js",
"jinit": "./node_modules/.bin/jasmine init",
"npminit": ""
},
"repository": {
"type": "git"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.2",
"bootstrap": "^4.0.0",
"express": "^4.16.3",
"jquery": "^3.3.1",
"lodash": "^4.17.5",
"popper.js": "^1.14.1"
},
"homepage": "/",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.3",
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^0.28.10",
"dotenv-webpack": "^1.5.5",
"eslint": "^4.18.2",
"eslint-loader": "^2.0.0",
"html-webpack-plugin": "^3.0.6",
"jasmine": "^3.1.0",
"jasmine-core": "^2.99.0",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jquery": "^0.2.2",
"karma-webpack": "^2.0.13",
"style-loader": "^0.20.3",
"uglifyjs-webpack-plugin": "^1.2.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.11",
"webpack-dev-server": "^3.1.1"
}
}
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="scripts.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="scripts.js" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
I followed this sample node.js app: nodejs-docs-hello-world and deploy it to azure.It works fine,please refer to web.config
file:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation batch="false" />
</system.web>
<system.webServer>
<handlers>
<add name="iisnode" path="scripts.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="myapp">
<match url="/*" />
<action type="Rewrite" url="scripts.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
I suggest you navigating to the KUDU
url: https://<your app name>.scm.azurewebsites.net/DebugConsole
and go to sitewwwroot
to check if the files are contained within a directory.
Or discard zip deploy temporarily, just drag the local files directly to the d:homesitewwwroot
directory and try again.
For more solutions, please refer to the threads as below:
2.https://github.com/Azure-Samples/nodejs-docs-hello-world/issues/9
Hope it helps you ,any concern please let me know.
这篇关于“您无权查看此目录或页面"Azure 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!