Using App registration instead of legacy service principal results in SharePoint Add-in installation error (The operation took too long)

fredj-6392 1 Reputation point
2022-07-06T14:13:55.503+00:00

Hi,

I am currently using MSOnline Powershell module (New-MsolServicePrincipal) to register an app, so SharePoint Add-in can be added and installed on the tenant afterwards. This mimics app registration through AppRegNew. aspx. Since MSOnline module is getting deprecated, and ServicePrincipalType that is getting created is Legacy, I am trying to use other modules to register an app. Currently I am using Azure Az module (New-AzADApplication and New-AzADServicePrincipal) to create an App Registration and Service Principal associated with it.

The issue I have now is that when I am trying to install SharePoint Add-in, installation fails with the ‘The operation took too long.’ error:

218128-screenshot-2022-07-06-135351.png

Creating app registration together with service principal manually through Azure AD gives the same result, but if creating it through AppRegNew .aspx everything works properly. If someone has encountered this before or knows what the issue might be I would appreciate any help.

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-07-07T09:09:22.337+00:00

    Hi @fredj-6392
    Per my test, I will get the same error register app with Service Principal and it fixed with the app registered in AppRegNew .aspx.
    218510-image.png
    After research some document. I will recommend to create it through AppRegNew .aspx like following document
    https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/register-sharepoint-add-ins


    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.



  2. Rohit Mishra 1 Reputation point
    2022-07-08T21:28:23.07+00:00

    Hi,

    Not sure about the issue part but I have noticed that you can't specify domain while registering an app in azure portal whereas it's possible from AppRegNew.aspx. You will not require domain for any background process however if you are creating a provider hosted add-in, it is needed.

    Regards

    0 comments No comments

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.