Hello Danny A Muntean,
Thank you for reaching out to Microsoft Support!
It sounds like you’re encountering a limitation with the Sites.Selected
permission scope. Here are some insights and potential solutions to your questions:
- Additional Configuration Steps or Permissions: The
Sites.Selected
permission scope is designed to provide granular access to specific sites. However, it appears that search functionality is not fully supported with this permission alone. This is why addingSites.ReadWrite.All
resolves the issue, as it grants broader permissions that include search capabilities. - Expected Behavior: Yes, this behavior is expected. The
Sites.Selected
permission scope does not inherently support all operations, including search. The error you’re encountering (generalException
) indicates that the operation is not permitted with the current permission set. - Performing Search Operations Without
Sites.ReadWrite.All
: Unfortunately, to perform search operations within the selected sites, you might need to use broader permissions likeSites.ReadWrite.All
. However, you can mitigate the risk by carefully managing the application’s access and ensuring it only interacts with the intended sites. Another approach could be to use delegated permissions if user context is available, but this might not fit your app-only scenario.
In summary, the Sites.Selected
permission scope has limitations regarding search functionality. Using Sites.ReadWrite.All
is a workaround, but it does broaden the access scope. You might need to balance the need for search functionality with the security implications of broader permissions.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.