Search code examples
azurevisual-studio-2013visual-studio-lightswitchhttp-status-code-403

403 - Forbidden: You do not have permission to view using the credentials that you supplied


After resolving some issues with deployment of my LightSwitch app to Azure, I was able to get the Azure Management Portal to report that everything was up and running fine. However when I try to access the site, I receive:

Server Error

403 - Forbidden: Access is denied.

You do not have permission to view this directory or page using the credentials that you supplied.

This happens regardless of whether I have HTTPS required or not and regardless of the browser used. When this point is reached, no login has been presented and so no credentials have been supplied.

I can't see anything out of the ordinary in Fiddler that would cause this issue.

What should I been looking for to diagnose this problem?


Okay, it turns out that clicking on the site.cloudapp.net link like I used to be able to do causes a 403 Forbidden code. I now need to go to site.cloudapp.net/DesktopClient for some reason and then my site will appear.

Is there a specific reason for this change in behavior? Was there any sort of announcement? Is there any way to change it back to just site.cloudapp.net?


Solution

  • Paths in various files needed to be changed.

    In Web.config:

    <defaultDocument>
      <files>
        <clear/>
        <add value="default.htm"/>
      </files>
    </defaultDocument>
    

    Needs to be:

    <defaultDocument>
      <files>
        <clear/>
        <add value="DesktopClient/default.htm"/>
      </files>
    </defaultDocument>
    

    In default.htm:

    <script type="text/javascript" src="Silverlight.js"></script>
    

    Needs to be:

    <script type="text/javascript" src="/DesktopClient/Silverlight.js"></script>
    

    And:

    <param name="source" value="Web/ARIS2.DesktopClient.xap"/>
    

    Needs to be:

    <param name="source" value="/DesktopClient/Web/ARIS2.DesktopClient.xap"/>
    

    The front most slashes in the last two are important because of this answer.