Add-PnPFile : Cannot contact site at the specified URL https://<<Customer Tenant>>.sharepoint.com/sites/Training. The app principal does not exist.

TCMS Admin 20 Reputation points
2024-10-01T06:57:43.2366667+00:00

Hello Team,

Getting error while executing Add-PnPFile command. 

Add-PnPFile : Cannot contact site at the specified URL https://<<Customer Tenant>>.sharepoint.com/sites/Training. The app principal does not exist.

 

By going through some articles, (https://sharepoint.stackexchange.com/questions/308459/getting-error-the-app-principal-does-not-exist-when-connecting-to-sharepoint-o).

I have created the app ID & Secret for https://<<Customer Tenant>>.sharepoint.com/sites/Training SP URL & provided the Full control Permission before I click on Trust.

 Permissions given for SharePoint APP ID:

<AppPermissionRequests AllowAppOnlyPolicy="true"><AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl"/><AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl"/></AppPermissionRequests>

But Still same Error.

Any help ?

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.
3,063 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,630 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xyza Xue_MSFT 25,731 Reputation points Microsoft Vendor
    2024-10-02T01:43:52.3133333+00:00

    Hi @TCMS Admin ,

    Hello, this problem has appeared in my tests as well, which is really very strange. I think it might be a sudden problem caused by a recent update and I haven't been able to find a useful solution yet. It is difficult for us to continue to solve the problem quickly for you through the forum. In order for you to have a better experience in solving the problem efficiently, we recommend you to create a new service request in the M365 Admin Center as an administrator, so that a more professional person will be able to help you.

    (Microsoft 365 admin center >> Help & support)

    User's image


    If the answer is helpful, please click "Accept as 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

0 additional answers

Sort by: Most helpful

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.