Getting following "You do not have permission to view this directory or page" while creating SharePoint app using VS 2019

S.P Singh 1 Reputation point

Environment: -

OS: - Windows 10

IE: - Microsoft Edge Version 97.0.1072.76 (Official build) (64-bit)

IDE: - VS 2019

Error Type: - Persistent

Project Type: For SharePoint Online with C#

Priority: - Critical


Description: - We are implementing Remote Event Receiver for Online and for that we referred following link

After creating project, I created an web app in Azure Portal Account and we have published the app using VS 2019 on web app, but it is giving following error.


Kindly assist, I will be really thankful.

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,396 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,541 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 26,791 Reputation points Microsoft Vendor

    Hi @shivpratap-3010 ,
    You need to upload certificate file if you are using Azure AD App-Only. So I will recommend you to register SharePoint App-Only. You can refer to the following document to grant access.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. sadomovalex 3,621 Reputation points

    browsing of the root domain folder may be disabled - it is not a problem (i.e. actual API endpoint which will be used for remote event receiver may still work regardless of this error). Try to go through all steps in the guide to the end and see will it work.

    Also if you are new with that I would recommend test things first with simpler scenario with AF with anonymous access and see how it works: Use Azure function as remote event receiver for Sharepoint Online list and debug it locally with ngrok.