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

How to programmatically remove packages & all its application customizers #7947

Closed
1 of 9 tasks
mgrosperrin opened this issue May 9, 2022 · 10 comments
Closed
1 of 9 tasks
Assignees
Labels
area:csom/rest/api Category: SharePoint Client Side Object Model SDK / REST API area:spfx Category: SharePoint Framework (not extensions related) Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. status:fixed-next-drop Issue planned to be fixed in an upcoming release.
Milestone

Comments

@mgrosperrin
Copy link

What type of issue is this?

Question

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Issue description

Hello,
I am working for an ISV that sells SharePoint packages containing WebParts and/or application customizer.
When one of our clients unsuscribe our solution, we want to remove all our packages and their content from their tenant.

We use the REST API to do so, and it works fine to remove packages containing WebParts: the package is not anymore in the app catalogs and the WebParts are not displayed anymore.
Unfortunaly, for the packages containing application customizers, while the package is removed from the app catalog, the application customizers remain actives. This is not the case when we remove the package via the UI in the app catalog site.

Do you have any advice on how to really remove packages?

@ghost
Copy link

ghost commented May 9, 2022

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 Awaiting categorization and initial review. label May 9, 2022
@mgrosperrin
Copy link
Author

Hello,
After more investigation, I have a really strange behavior when removing the package via the REST API:
If I reload the page with F5, the application customizer is active, but if I reload the page with CTRL+F5, the application customizer isn't run.

@AJIXuMuK AJIXuMuK added area:spfx Category: SharePoint Framework (not extensions related) area:csom/rest/api Category: SharePoint Client Side Object Model SDK / REST API and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels May 10, 2022
@lucabandMSFT
Copy link
Collaborator

@mgrosperrin , how do you associate the application customizer to the site? if you do that during Site action (content --> add an app) then you need to use the same ALM APIs to remove the solution from the site before removing the package from the app catalog (reference here: https://docs.microsoft.com/en-us/sharepoint/dev/apis/alm-api-for-spfx-add-ins?tabs=sprest).

If customers associated the customizer manually (e.g. PowerShell script), then the removal needs to happen manually.

@lucabandMSFT lucabandMSFT added the Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. label May 10, 2022
@mgrosperrin
Copy link
Author

Hi @lucabandMSFT,
I am not sure to understand what you mean by "associate the application customizer to the site".
We currently install the package in the App Catalog using the (now deprecated) SharePointPnPPowerShellOnline PowerShell module (that ultimately use the REST API).
We add the package (Add-PnPApp) and then publish them (Publish-PnPApp).
I try several combinaison of commands to uninstall/remove (Unpublish-PnPApp, Uninstall-PnPApp, Remove-PnPApp) and observed behavior is really strange:
The package is not listed anymore in the App Catalog, but the customizer run when I refresh the page (via F5) and not when I "hard-refresh" the page (via CTRL-F5) (and it runs again if I refresh the page).

@ghost ghost added Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. and removed Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. labels May 11, 2022
@AJIXuMuK
Copy link
Collaborator

@mgrosperrin - are you using "tenant-wide" deployment or no?

@AJIXuMuK AJIXuMuK added Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. and removed Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. labels May 11, 2022
@mgrosperrin
Copy link
Author

@AJIXuMuK yes in this case I use a tenant-wide deployment

@ghost ghost added Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. and removed Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. labels May 11, 2022
@mgrosperrin
Copy link
Author

Hello,
I did some new tests for a package that contains WebPart, when I remove it (manually or via the API), the WebParts currently added on a page are still available, and we can continue to add them. WebParts contained in the package but not present on the page are not in the catalog however.

This behavior is really strange and annoying for people selling third-party components...

@AJIXuMuK AJIXuMuK self-assigned this May 13, 2022
@AJIXuMuK AJIXuMuK added the status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. label Jun 2, 2022
@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue planned to be fixed in an upcoming release. and removed status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. labels Jun 24, 2022
@AJIXuMuK AJIXuMuK added this to the 06-24 milestone Jun 24, 2022
@AJIXuMuK
Copy link
Collaborator

@mgrosperrin - the fix has been implemented and will be rolled out in the next couple of weeks.

@AJIXuMuK
Copy link
Collaborator

it should be rolled out WW by now.

@ghost
Copy link

ghost commented Jul 19, 2022

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@ghost ghost locked as resolved and limited conversation to collaborators Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:csom/rest/api Category: SharePoint Client Side Object Model SDK / REST API area:spfx Category: SharePoint Framework (not extensions related) Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. status:fixed-next-drop Issue planned to be fixed in an upcoming release.
Projects
None yet
Development

No branches or pull requests

3 participants