4

I understand stand the App upgrade process for a SharePoint hosted app and when I update my App Catalog for the web application I then can upgrade the app successfully manually for a site.

But my question is my site collection contains 20+ sites. Each site uses the app. In the past when using solutions I used a Site collection feature, updated the feature and all sites got the upgrade.

How can I have all 20+ sites update to the newer version without going through each site manually and updating it one site at a time?

Thanks.

3

Like with most things of this nature it's PowerShell to the rescue. Basically you can get the App instance, Import the updated package, then update the instance with the new package.

$AppInstanceOnSite = Get-SPAppInstance -web "<URL>" | Where {$_.Title -eq "<AppName>"};
$NewAppFile = Import-SPAppPackage -Path <local path to .app file> -site <URL> -source ObjectModel;
Update-SPAppInstance -identity $AppInstanceOnSite -App $NewAppFile;

As far as I know there is now way to retrieve the app package without importing it via PowerShell (that is if you already deployed it). It's possible this slipped by me in some update, if anyone is aware maybe that can add that here.

Just to add clarity here - there is another method for deploying Apps. You can deploy the App directly to the App catalog site and allow a shared instance to be provisioned on sites. When you do this all sites share the same "app web" that is deployed to the Catalog site, so in this scenario when you upgrade the App every one is "upgraded" because it's not really deployed to all those sites. Beyond the shared assets drawback, you also can't deploy anything to host webs.

| improve this answer | |
  • Jesus thanks for getting back to me. Actually I was looking into the Import-SPAppPackage PS command but I was completely stuck on what app catalog it was putting it in, because it wasnt updating the web application catalog. Also, I looked at the Shared Instance but that doesnt seem to work with app parts :(. It just works for full page apps. – NYTom Dec 12 '14 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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