Getting error after pushing to Windows Azure: You do not have permission to view this directory or page

后端 未结 9 1357
[愿得一人]
[愿得一人] 2020-12-15 16:30

I have googled for the past 3 hours and found nothing on what to do with respect to the windows azure problem:

You do not have permission to view this

相关标签:
9条回答
  • 2020-12-15 16:40

    Simple configuration, in the azure portal go to your web app -> All settings -> application settings, under default documents add the specific name of your document which you want to view, wait for it to update, then refresh your azure link.

    0 讨论(0)
  • 2020-12-15 16:44

    I had the same error message after a git push from a local repository.

    Solved it by opening the Azure dashboard:

    Web app / App deployment / deployment source

    and selecting local git repository as deployment source

    0 讨论(0)
  • 2020-12-15 16:46

    I hit this error too. I am using MVC and the reason for the error was that on my layout page I had a call to an action that isn't accessible to anonymous users:

    @Html.Action("GetMenu", "Users")  
    

    For information, I register a AuthorizeAttribute() global filter in Application_Start and my Login action is decorated with AllowAnonymous:

        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]
        public ActionResult Login(LoginModel model, string returnUrl)
        {
    

    My website did work previously on IIS7, but Azure is less forgiving. I fixed the problem by adding a check like this:

    @if (User.Identity.IsAuthenticated)
    {
         @Html.Action("GetMenu", "Users")
    }
    
    0 讨论(0)
  • 2020-12-15 16:48

    AvkashChauhan's answer did lead me in the right direction but I also had to add proper rewriting rules. Here is my complete web.config

    <?xml version="1.0"?>
    <configuration>
      <system.web>
        <compilation batch="false" />
      </system.web>
      <system.webServer>
        <handlers>
          <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
        </handlers>
        <rewrite>
          <rules>
            <rule name="myapp">
              <match url="/*" />
              <action type="Rewrite" url="server.js" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>
    
    0 讨论(0)
  • 2020-12-15 16:50

    Not specific to node.js but updating in case it helps others facing this issue for a regular web application. This can also happen if the index.html file is not present or is not found because it is in a sub-directory

    0 讨论(0)
  • 2020-12-15 16:53

    I just came across this issue and in my case it was the ipSecurity configuration that was causing the issue. Just hd to go and change the allowUnlisted to true.

     <security>
       <ipSecurity allowUnlisted="false"> 
     </security>
    
    0 讨论(0)
提交回复
热议问题