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

S.P Singh 31 Reputation points
2022-02-04T15:10:48.327+00:00

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 https://www.spguides.com/remote-event-receivers-in-sharepoint-online/

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.

171451-msdn1.png

Kindly assist, I will be really thankful.

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,481 Reputation points Microsoft External Staff
    2022-02-07T01:59:45.19+00:00

    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.
    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs


    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,636 Reputation points
    2022-02-08T15:27:28.683+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.