13

I created a SharePoint Framework web part and deployed the package to the App Catalog on my client's O365 tenancy. My client has added the web part to around 150 sites.

I've since deployed a new version of the package, which contains some important updates to the web part, to the App Catalog. I can upgrade the web part manually on each site from the Site Contents page (i.e. exactly the same as the add-in model). However, I don't really want to do this manually 150 times. As far as I can see, there aren't any hooks for automating or scripting this (CSOM, PnP PowerShell ,etc) - any ideas?

Edit - to clarify the behaviour I'm seeing, here's a couple of screenshots. On the Site Contents page: enter image description here

And on clicking through:

enter image description here

5
  • 1
    If you only updated the code, you should be able to simply redeploy your assets to your CDN location. Commented Jun 13, 2017 at 13:15
  • 1
    did you change the version number, or have you added any new properties? these seem to cause isues .
    – RussGove
    Commented Jun 14, 2017 at 0:51
  • Thanks guys. I did change the version number of the package. Redeploying the assets to the CDN won't solve the problem alone, as the SPFx tooling generates different unique names for various assets every time you bundle - so we do also need to deploy a new sppkg to the App Catalog (either that or hack around with the build process).
    – Jason Lee
    Commented Jun 14, 2017 at 8:39
  • 2
    If you do don't change the version number you wont need to do the upgrade.
    – RussGove
    Commented Jun 14, 2017 at 12:19
  • Thanks @russellg - that did the trick. I rebuilt the package using the original version number and redeployed to the App Catalog. All instances of the SPFx web part are now using the updated code.
    – Jason Lee
    Commented Jun 15, 2017 at 10:05

3 Answers 3

7

You shouldn't need to "upgrade" anything. As soon as you update the package in the app catalog, all running webparts will use the updated manifest, which should point to the updated code.

2
  • 2
    Thanks, but that's not the behaviour I'm seeing. On each site that includes the web part, on the Site Contents page, I see the message An update for this app is available (i.e. the behaviour is exactly the same as the add-in model). I can either leave the site running the old version of the web part, or I can click GET IT and get the new version. I did change the package version number before I re-deployed to the app catalog - if I left this unchanged (not a great software development practice), would the web parts automatically use the updated manifest?
    – Jason Lee
    Commented Jun 14, 2017 at 8:18
  • 2
    Yes - they should use the updated manifest. If there was additional upgrade actions in your feature XML you would need to explicitly update them. This is good feedback though - ideally we shouldn't say "upgrade this" if upgrading isn't going to do anything material. Commented Jun 14, 2017 at 18:24
1

Here is something I recently did to bulk upgrade the solution in a scenario where I added new webparts to a project and had to increment the version number. This meant I had to upgrade the solution in each site collection that it was deployed to : http://vipulkelkar.blogspot.com/2018/08/bulk-upgrade-spfx-solution-in-multiple.html

0

I had something similar

First I didn't use the skipFeatureDeployment then I tried setting it to TRUE to have the webpart available to all subsites (my AppCatalog is Site collection scoped)

  "skipFeatureDeployment":true,

then I had to use the Update commande with powershell

Connect-PnPOnline -URL $site -Credentials $credentials   

Add-PnPApp -Path $appPath -Scope Site -Publish -Overwrite -SkipFeatureDeployment

$addedApp = Get-PnPApp  -Scope Site -Identity bcaff853-6bfb-4391-af92-8f387f36e843

Update-PnPApp -Identity $addedApp.Id -Scope Site

Get-PnPApp -Identity $addedApp.Id -Scope Site 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.