Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up unsused API permissions #732

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

kkazala
Copy link
Contributor

@kkazala kkazala commented Aug 26, 2024

The scripts\spo-delete-unused-spfx-apipermissions\Cleanup-APIPermissions.ps1 script is an enhancement of the previous version, GET API Permissions for SPFx solutions, designed to run without user interaction and without the need to temporarily assign owner rights to the current user.
It now supports scheduling when used in Azure Automation and includes the capability to delete unused permissions.

The scripts\aad-grant-serviceprincipal-api-permissions\Grant-APIPermissions_ManagedIdentity.ps1 configures minimum required permissions necessary for Managed Identity to execute the Cleanup-APIPermissions.ps1:
Microsoft Graph API
- 'Application.Read.All',
- 'Sites.Selected'
- 'DelegatedPermissionGrant.ReadWrite.All'

and read on root SPO site, tenant-level app catalog and any site-level app catalog site

@kkazala kkazala mentioned this pull request Aug 26, 2024
2 tasks
@pkbullock
Copy link
Collaborator

Hi @kkazala - I have created 2 new samples based on your submission, thank you, for the update to GET API Permissions for SPFx solutions - its a PowerShell script rather than update to the Readme containing the script, would you like me to update that Readme with the contents of the PowerShell script?

@pkbullock pkbullock merged commit 1412ec4 into pnp:main Aug 28, 2024
@pkbullock
Copy link
Collaborator

Ill merge, what is there to get these published, and let me know what you would like to do and I can support the response above. Thank you again!

@kkazala
Copy link
Contributor Author

kkazala commented Aug 30, 2024

for the update to GET API Permissions for SPFx solutions - its a PowerShell script rather than update to the Readme containing the script, would you like me to update that Readme with the contents of the PowerShell script?

Please don't :) it will break the sample.
I'm sorry for making this mess- I copied my *.ps1 files to the corresponding folders to make sure I don't mix them up when preparing the samples. And regarding the old sample- I got scared for a moment that maybe I forgot to add "/lists" so I put it there as a "note to self" to test. The old version works, there's nothing to change, I'll make a new PR to remove the *ps1 files once I'm next to a computer:)
Thank you so much for your help 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants