following tutorial and have encountered problem You do not have permission to view this directory or page

Marcus Giddings 1 Reputation point
2021-02-25T15:02:35.183+00:00

I have been following this tutorial, but as azure no longer support web app redirects to HTTP website I have created a web app in azure as this as standard has HTTPS.

I have followed the tutorial to the section get user details and have tested it locally using

PHP artisan serve

and all seems fine however when I have deployed it to azure via visual code I get

You do not have permission to view this directory or page.

as the tutorial is meant for a local instance am I missing something or have I missed a step any help would be grateful also I'm new to azure web apps and laravel so please try to explain things to a basic knowledge level.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,646 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 22,416 Reputation points Microsoft Employee
    2021-03-03T17:05:53.09+00:00

    @Marcus Giddings , Adding to James response:

    Laravel, uses the public/ subdirectory as the site root.

    The default PHP image for App Service uses Apache, and it doesn't let you customize the site root for your app.
    To work around this limitation, add an .htaccess file to your repository root with the following content:

    Ensure that all the files are correctly added in the folders.

    <IfModule mod_rewrite.c>  
        RewriteEngine on  
        RewriteCond %{REQUEST_URI} ^(.*)  
        RewriteRule ^(.*)$ /public/$1 [NC,L,QSA]  
    </IfModule>  
    

    You may inspect the log files to fetch more details on the error.
    https://<your-app-name>.scm.azurewebsites.net/api/logs/docker.

    See this doc for more details on configure a PHP app for Azure App Service.

    Kindly let us know the status, we will be more than happy to assist you further.

    0 comments No comments