Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure: "You do not have permission to view this directory or page

I have created a node.js application in Visual Studio 2015 using the Azure SDK 2.7 and the Node.js Tools.

I have successfully set up CI with BitBucket in my web app and I can see that changes to the repository do indeed trigger a build and deploy.

However, the page I reach (http://ftct.azurewebsites.net/) complains: You do not have permission to view this directory or page.

I have specified a default file (kinda) in my node.js by using: app.get('/', routes.index);

So trying to navigate directly to this file, http://ftct.azurewebsites.net/signin.html, yields a different error: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

I configured the app to run on port 1337 in Visual Studio, but using this port doesn't overcome the problem. Trying to navigate to a ported address yields a timeout.

Any ideas?

like image 758
serlingpa Avatar asked Nov 20 '15 20:11

serlingpa


People also ask

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

Also suggest you to check the IP restrictions or authentication settings on the Azure web application that may block you. Check Web App > Authentication /Authorization and Web App > Networking > Access Restrictions. Create the production build by executing 'npm run build' command.

How do I grant application permissions in Azure?

Grant admin consent in App registrationsSelect Azure Active Directory, and then select App registrations. Select the application to which you want to grant tenant-wide admin consent. Select API permissions. Carefully review the permissions that the application requires.

How do I give permission to APP registration in Azure?

In the Azure portal, navigate to your key vault and select Access policies. Select Add access policy, then select the key, secret, and certificate permissions you want to grant your application. Select the service principal you created previously. Select Add to add the access policy, then Save to commit your changes.

How do I check app permissions in Azure portal?

Review application permissionsSelect Azure Active Directory, and then select Enterprise applications. Select the application that you want to restrict access to. Select Permissions. In the command bar, select Review permissions.


1 Answers

I had the same issue,

you need web.config, package.json, server.js at the root

web.config:

<configuration>
    <system.webServer>
        <handlers>
            <!-- indicates that the app.js file is a node.js application to be handled by the iisnode module -->
            <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
        </handlers>
        </system.webServer>
</configuration>

in package.json you need to have:

 ...
  "scripts": {
    "start": "node server"
  },
...

and in your server.js make sure that you set the server port number to

process.env.PORT || 1337;

like image 161
nimatra Avatar answered Sep 19 '22 07:09

nimatra