简体   繁体   English

无法将 Node js 应用程序部署到 Azure(“没有权限”)

[英]Cannot deploy Node js app to Azure ("do not have permission")

I have a Wordle-esque app that I want to deploy using Azure.我有一个想要使用 Azure 部署的 Wordle 式应用程序。 Repo here<\/a> .在这里<\/a>回购。 It is a fork from a popular open-source project, and I can also locally build and run the game.它是一个流行的开源项目的一个分支,我也可以在本地构建和运行游戏。 Locally, it runs perfectly.在本地,它运行完美。

I am trying to use Azure App Services to deploy it, using a Github Action.我正在尝试使用 Azure 应用服务来部署它,使用 Github 操作。 All the Actions pass, and the App can be successfully built.所有的Actions都通过了,App就可以构建成功了。 However, when I try to view the deployment here<\/a> the only error I am receiving is但是,当我尝试在此处<\/a>查看部署时,我收到的唯一错误是

You do not have permission to view this directory or page.<\/code>

Since it runs locally, and it pass its github action build, I do not know how to proceed here.由于它在本地运行,并且它通过了它的 github 操作构建,所以我不知道如何在这里进行。 I have tried restarting the app, and changing the resources I am using to host it, but that does not work.我已尝试重新启动应用程序,并更改用于托管它的资源,但这不起作用。 Some other answers seem to suggest the problem is about it not finding index.html<\/code> , but I can access that through https:\/\/shetland-wordle.azurewebsites.net\/public\/index.html<\/a> and the page is blank.其他一些答案似乎表明问题在于它没有找到index.html<\/code> ,但我可以通过https:\/\/shetland-wordle.azurewebsites.net\/public\/index.html<\/a>访问它并且页面是空白的。

Any help would be appreciated任何帮助,将不胜感激

"

You do not have permission to view this directory or page.您无权查看此目录或页面。

  • We can set a default page to a Windows Azure Web App.我们可以将默认页面设置为 Windows Azure Web App。
  • In web.config , specify the default page within the System.WebServer section.web.config中,指定System.WebServer部分中的默认页面。
  • If you do not have web.config , create one in azure portal=>your web app => Advanced Tools =>Go => Debug Console => CMD=>site=> wwwroot folder.如果您没有web.config ,请在 azure portal=>your web app => Advanced Tools =>Go => Debug Console => CMD=>site=> wwwroot 文件夹中创建一个。
<system.webServer>
  <defaultDocument>
      <files>
        <clear/>
        <add value="index.html"/>
      </files>
  </defaultDocument>
<system.webServer>  
    

Your index.html will be respected as the default document of the web site, and therefore will be served when the client requests for the root URL.您的index.html将被视为网站的默认文档,因此将在客户端请求根 URL 时提供服务。

OR或者

  • If the files show up under /wwwroot/your-app-folder/ you may get this permission issue.如果文件显示在 /wwwroot/your-app-folder/ 下,您可能会遇到此权限问题。
  • Make sure your index.html is under wwwroot folder确保您的index.htmlwwwroot文件夹下
  • Add the default document in the project root folder and set it as default page in appsetting on the Azure portal and save the setting.在项目根文件夹中添加默认文档,并在 Azure 门户的 appsetting 中将其设置为默认页面并保存设置。

The default document is the web page that is displayed at the root URL for a website.默认文档是显示在网站根 URL 处的网页。

![在此处输入图像描述

  • Navigate to KUDU url: https://<your app name>.scm.azurewebsites.net/DebugConsole and go to site\\wwwroot to check if the files are contained within a directory.导航到KUDU url: https://<your app name>.scm.azurewebsites.net/DebugConsole并转到site\\wwwroot以检查文件是否包含在目录中。

  • If you find any files missing , re-deploy the app.如果您发现任何文件丢失,请重新部署该应用程序。

Please refer similar issues S1 , S2 and S3 for more information.请参阅类似的问题S1S2S3以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM