APPS GALLERY

Create an App Registration for SharePoint Integration

A guide to creating an app registration in Microsoft Entra ID for integrating with SharePoint Online. This is required for enabling features that require authentication and authorization with Microsoft Graph API or SharePoint REST API.

1

Create App Registration

Login to portal.azure.com and go to Microsoft Entra ID.

  1. 1. Open App registrations

    In the left hand side pane, click App registrations.

    App registrations menu in Microsoft Entra ID
  2. 2. Create a new registration

    Click the New registration button in the right hand side pane. The following screen will show up. Enter a name for the app registration and click Register.

    Register a new application screen
  3. 3. Open API permissions

    Once it is created, the app registration page will open. Navigate to API Permissions.

    API permissions tab on the app registration page
  4. 4. Add the required Application permissions

    Click Add a permission in the right hand side pane to add the required Application permissions:

    • Sites.Manage.All
    • Sites.ReadWrite.All
    Selecting Sites.Manage.All and Sites.ReadWrite.All application permissions

    Click Add permissions to complete this step.

    If you want to give permission to specific sites instead of all sites, you can choose the Sites.Selected permission and follow this Microsoft article to create Manage and ReadWrite permissions for specific sites.

  5. 5. Grant admin consent

    You will then see the permissions are added and being displayed in the configure permissions table. Now click the Grant admin consent button.

    Note: you will need the Global Admin role to be able to grant admin consent.
    Grant admin consent for the configured permissions
2

Generate Certificate

Use the PowerShell script below to generate a .cer certificate file.

$cert = New-SelfSignedCertificate -Subject "CN=AppsGallerySPCert" `
    -CertStoreLocation "Cert:\CurrentUser\My" `
    -KeySpec Signature `
    -NotAfter (Get-Date).AddYears(99)

Export-Certificate -Cert $cert -FilePath "<your local path>\AppsGallerySPCert.cer"

The second line of the script saves the .cer file to your local file system. Browse to that folder to confirm you can see the .cer file.

  1. 1. Open Manage user certificates

    Click the Start menu of your Windows machine and search for "Manage user certificates".

    Searching for Manage user certificates from the Start menu
  2. 2. Export the private key (.pfx)

    Locate the certificate you created and export the private key (.pfx) file to your local disk.

    Exporting the certificate private keySelecting the option to include the private key in the exportChoosing the export file format for the certificate
  3. 3. Set a password

    Note: You need to enter a password on the screen below. Keep note of the password — you will need to supply it when setting up the connection later.
    Entering a password to protect the exported .pfx file

    Then save the .pfx file to your local file system.

You should now have two certificate files:
  • The .cer file — uploaded against the app registration.
  • The .pfx file — uploaded into D365.
3

Upload .cer to App Registration

Go to the Azure portal and locate the app registration you created in the previous step.

  1. 1. Open Certificates & secrets

    Click on Certificates & secrets, and locate the Certificates tab in the right hand side pane.

    Certificates and secrets section of the app registration

    Click Upload certificate and select the .cer file from your local file system. Once successfully uploaded, you should see the certificate in the list.

  2. 2. Capture the Client Id and Tenant Id

    Now go back to the Overview page of this app registration. Take note of the Client Id and Tenant Id as shown below — you will need them to complete the connection setup in D365.

    Client Id and Tenant Id on the app registration overview page
?

Need more help?

Reach out via the Contact Us page and we'll get back to you.

Create an App Registration for SharePoint Integration | APPS GALLERY