Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 directory or page.

I did a git master push to azure and the deployment was successful. I also turned on the failed request tracing but nothing shows up but the above statement.

Any ideas on how to troubleshoot this?

like image 312
DasBoot Avatar asked Jul 12 '12 21:07

DasBoot


People also ask

How do you fix You do not have permission to view this directory or page Azure?

Check Web App > Authentication /Authorization and Web App > Networking > Access Restrictions. Create the production build by executing 'npm run build' command. A build folder will be generated in the solution with some meta data files. Reference the build folder while deploying the react app to azure.

How do I add permissions to Azure application?

Select Azure Active Directory > App registrations, and then select your client application. Select API permissions > Add a permission > Microsoft Graph > Application permissions.

How do I change my Azure Web config?

If you want to change web. config files you can use the Azure portal, there is a tool called "App Service Editor" in preview or Kudu that lets you edit any of the files you've deployed.

How do I access the Kudu console?

To access the KUDU console, you need your Azure credentials, and navigate to https://****.scm.azurewebsites.net, where **** is the name of your Function App. Note you can also get access through the platform feature in the portal by clicking the Advanced tools (KUDU).


2 Answers

I just tested that if you don't deploy your main node.js file as server.js you will get this error because the web.config is specifically looking for server.js as below:

  <handlers>        <add name="iisnode" path="server.js" verb="*" modules="iisnode"/>  </handlers> 

To further troubleshot this issue you can access the website over FTP as described here.

like image 58
AvkashChauhan Avatar answered Sep 23 '22 19:09

AvkashChauhan


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> 
like image 21
Ben Anderson Avatar answered Sep 19 '22 19:09

Ben Anderson