API permissions for Sharepoint using Azure portal

·

2 min read

Introduction : To achieve some functionality using sharepoint webpart,sometime you webpart/extension/sharepoint might requires additional API permission.For that, update your package-solution.json file to include the required APIs. Then request could be seen by administration under API access in sharepoint. API permissions page: image.png I found two scenarios where we need to add API permissions manually:

  1. Test the webpart/extension with deploying on to environment

  2. For suppose if your sharepoint site has a development, test, and production environment. If you deploy the sharepoint webpart or extension in a test or production environment and if admin configure M365 Sharepoint such that API requests will be available on the API access(as in the above figure) page. As a result, you might not notice an API permissions request while deploying a webpart to a development environment. In these circumstances, we must add the necessary Azure Portal permissions.

Steps to manually add permissions

Step 1. Sign into https://portal.azure.com > Azure active directory > App registrations > All Applications > search for sharepoint > select sharepoint client extensibility web application principal

image.png Step 2. Select API Permissions > ➕ Add permissions > select microsoft graph or power BI service or required application.

image.png Step 3. Select Application permissions > search and select required permission >Add Permission

image.png Step 4. Grant admin consent

image.png

Step 5. After added required permission here, you can observe same permission in API access page under approved requests section Step 6. Now you can use your webpart for testing

Thank you, and I sincerely hope that you learned something new from my blog!!!