Grant Access to Selected Sites
Last updated
Was this helpful?
Last updated
Was this helpful?
If you want to grant users access to specific SharePoint sites through the Azure portal, follow the steps below:
Create connector for respective SharePoint site in Attach2Dynamics. Follow thisto know how to create connector.
Create azure app
Please follow the below steps to create Azure Active Directory (AAD) app:
Step 1 – Login into Azure portal –
Step 2 – Click on Azure Active Directory.
Step 3 – Navigate to App registrations and then click on new registration.
Name: Give a desired display name for the App.
Now click on “Register” button.
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.
• To add permissions, click on Dynamics CRM.
Grant User Impersonation access.
To add SharePoint permissions, navigate to Microsoft Graph.
Select “Application Permissions.”
To grant users access to selected sites, select “Sites.Selected” permission.
Select “Delegated Permissions.”
To grant users access to selected sites, select “Sites.Selected” permission, and click on “Add Permissions”.
Navigate to SharePoint.
Select "Application Permission."
• To grant users access to selected sites, select “Sites.Selected" permission.
Click on “Grant admin consent” button as shown below.
Navigate to “Authentication”, enable Access Tokens, and click on ‘Save’.
Now, navigate to Certificate & Secrets and click on New client secret to create a secret key.
Copy the “Application ID” and “Secret Key”.
Go to Dynamics 365 CRM and navigate to Attach2Dynamics app -> Connector Entity -> Credentials Tab and paste both “Application ID” and “Secret Key”.
To authenticate the connector, you’ll first need to run a PowerShell script.
Once you have installed PowerShell on your device. Open the PowerShell command window and select “Run as Administrator”.
• Now enter the syntax as &”file path\PowerShell script name” and click ‘Enter’ to Run the command.
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
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.
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.
• Once the script has been successfully executed navigate to Attach2Dynamics App -> Connectors entity, and click on the Authenticate Button.
After clicking on the Accept button if the credentials are correct then you will get a Success message window.
Redirect URL: Copy and paste the Redirect URL from the .
Download the PowerShell script from .
For any queries, reach out to us at