Skip to content

Cleanup the assets upon uninstalling the SPFx App #10318

@AvengerGithub01

Description

@AvengerGithub01

SPFx version 1.16
Sharepoint Online

Hello everyone,

I’ve recently developed a SharePoint Framework (SPFx) application that provisions various assets such as site columns, a document library, a content type, etc. These assets are being provisioned successfully when the app is deployed to a site.

However, I’m currently facing a challenge with the cleanup process. When the app is removed from the site, only the app itself is removed—any provisioned assets remain. At the moment, I am handling the cleanup manually using a PnP PowerShell script, but I would like to automate this process so that it occurs as part of the app uninstall process, similar to the behavior seen in SharePoint Add-ins.

Unfortunately, I haven’t found any native support in SPFx for handling an AppUninstall or AppRemove event that would allow this cleanup to happen automatically.

Has anyone faced a similar requirement or found a workaround for this? I’m open to any suggestions or recommended approaches for managing asset cleanup during SPFx app removal.

Thank you in advance for your help.

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions