Oct 11 2023 03:02 AM
Hi everybody,
I would like to automate the process of sending alerts when the SharePoint tenant storage quota reaches certain level of thresholds.
I have found that I can perform a GET call on the following endpoint https://<mytenantname>-admin.sharepoint.com/_api/StorageQuotas()?api-version=1.3.2 to obtain information such as 'TenantStorageMB', 'GeoUsedStorageMB' and 'GeoAvailableStorageMB'.
I can use Logic Apps and perform the action 'Send an HTTP request to SharePoint' (built-in SharePoint Online connector) to obtain the information by connecting it with a SharePoint Administrator user account. However, I would like to use a managed identity instead for improved security. Hence, I have followed these steps:
When I try to perform the same query, I get the following error message:
Oct 11 2023 12:57 PM
Oct 12 2023 05:03 AM
Thank you for your reply @NicolasKheirallah, helping me out.
I have been struggling for several hours to make this work now. On a demo tenant I have been able to make this work just fine and let Postman retrieve the list items of a list on a site collection, just for testing. Making use of the following article, also elaborating on SharePoint App-only permissions: https://global-sharepoint.com/sharepoint-online/in-4-steps-access-sharepoint-online-data-using-postm...
However, I am not able to retrieve the StorageQuotas from the tenant admin site using the Bearer access token. When I do so, I get the following error message: "{"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}"
Articles I found on the web seem to point to inappropriate set scope or incorrect permissions
I have followed the steps in your article to generate a new application, and for this test I had used the following permissions: <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />.
In Postman I have retrieved an access token as described here: https://global-sharepoint.com/sharepoint-online/in-4-steps-access-sharepoint-online-data-using-postm... and performed the request with in the Headers a key named 'Authorization' and for value 'Bearer <access token>'.
Oct 13 2023 11:44 AM
Oct 19 2023 08:18 AM