Grant Access to Selected Sites

If you want to grant users access to specific SharePoint sites through the Azure portal, follow the steps below:

  1. Create connector for respective SharePoint site in Attach2Dynamics. Follow this link to know how to create connector.

Note: For enabling this feature user must set “Allow Permission for Selected Site” field to “Yes”. This field is hidden on the form and user must make this field visible for enabling it.

  1. Create azure app

Please follow the below steps to create Azure Active Directory (AAD) app:

Step 1 – Login into Azure portal – https://portal.azure.com/

Step 2 – Click on Azure Active Directory.

Grant Access to Selected Sites

Step 3 – Navigate to App registrations and then click on new registration.

Grant Access to Selected Sites
Grant Access to Selected Sites
  • Now click on “Register” button.

Grant Access to Selected Sites

Step 4 – Now you need to give some permissions to app. So, navigate to API permissions. Here you need to go to “Add Permission” for Dynamics 365 CRM and SharePoint.

Grant Access to Selected Sites

• To add permissions, click on Dynamics CRM.

Grant Access to Selected Sites
  • Grant User Impersonation access.

Grant Access to Selected Sites
  • To add SharePoint permissions, navigate to Microsoft Graph.

Grant Access to Selected Sites
  • Select “Application Permissions.”

Grant Access to Selected Sites
  • To grant users access to selected sites, select “Sites.Selected” permission.

Grant Access to Selected Sites
  • Select “Delegated Permissions.”

Grant Access to Selected Sites
  • To grant users access to selected sites, select “Sites.Selected” permission, and click on “Add Permissions”.

Grant Access to Selected Sites
  • Navigate to SharePoint.

Grant Access to Selected Sites
  • Select "Application Permission."

Grant Access to Selected Sites

• To grant users access to selected sites, select “Sites.Selected" permission.

Grant Access to Selected Sites
  • Click on “Grant admin consent” button as shown below.

Grant Access to Selected Sites
  • Navigate to “Authentication”, enable Access Tokens, and click on ‘Save’.

Grant Access to Selected Sites
  • Now, navigate to Certificate & Secrets and click on New client secret to create a secret key.

Grant Access to Selected Sites

Note: Please copy the secret key immediately and keep it for future reference as it will disappear after some time.

  • Copy the “Application ID” and “Secret Key”.

Grant Access to Selected Sites
  • Go to Dynamics 365 CRM and navigate to Attach2Dynamics app -> Connector Entity -> Credentials Tab and paste both “Application ID” and “Secret Key”.

Grant Access to Selected Sites
  • To authenticate the connector, you’ll first need to run a PowerShell script.

  • Download the PowerShell script from here.

Note: User need to install PowerShell version 7.0 and above.

  • Once you have installed PowerShell on your device. Open the PowerShell command window and select “Run as Administrator”.

Grant Access to Selected Sites

• Now enter the syntax as &”file path\PowerShell script name” and click ‘Enter’ to Run the command.

Grant Access to Selected Sites

Note: Enter the file path where you have stored the PowerShell script in your device and the name of the PowerShell script in the above syntax.

  • Now, in the PowerShell command window, enter the following details:

    • SharePoint site URL

    • Azure App ID

    • Tenant Name

    • Secret key of Azure App

    • Display name of Azure App

Grant Access to Selected Sites
  • A Pop-up window will appear. Fill in your credentials and then a confirmation Pop-up will be opened. In the Pop-up, please select Consent on behalf of your organization --> Click on the Accept button.

Grant Access to Selected Sites
Grant Access to Selected Sites
  • Once the script has been executed successfully, you will be able to see “Completed” message on the command window, as shown in the below image.

Grant Access to Selected Sites

• Once the script has been successfully executed navigate to Attach2Dynamics App -> Connectors entity, and click on the Authenticate Button.

Grant Access to Selected Sites
  • After clicking on the Accept button if the credentials are correct then you will get a Success message window.

Last updated

Was this helpful?