Your .NET and Microsoft technologies specialist in Western Switzerland RSS 2.0
# Thursday, 06 March 2014

SS

Speaker : Ricky Kirkham

Updating a SharePoint app is necessary, of course, to fix a bug, but also to bring new functionality. In the past, solutions and features were rarely updated. Mainly because it was simpler to replace, and recycling the farm was required. But a replace strategy was less cost effective.

Because the developers don't know who are their customers (store apps), there is a need for notification when there is an update of the App. For non-store apps, migrations is harder. App web domains are different from an old and a new app.

App update is deployed in an app package, but has a different version number. A message says to the user that there is an update for an app. It is possible to directly update an app by going in the callout of the app.

It is not possible to force users to update. In some situations, the users may not have sufficient permissions. You can't assume that all instances of the app are in the previous version. Only one version of the app can be in the store. A consequence is that in an update scenario, it can't be assumed that the update is not an install. The app package has to support an initial install AND an update from any version. The version number is the only way for an app to see if there is a previous version of the app is deployed. If the update process does not successfully add a component, it simple won't be installed. It means that there are potentially inconsistencies even if the app has the same version, because an update on an instance failed to install a simple component. But, they will all have the same version number ! It is, by mistake, possible that different updates add the same column twice or more.

Best Practices 1 : Test the update with all the different previous versions of the app. So, install each version in different subweb of the test site and test the update on every one of them.

Best Practices 2 : Napa does not support updating app. VS is a must use. Rollback on error, and for all components, and data. It is almost automatic, but the developer has to help. The version number of the app manifest must be changed and the app package must be uploaded. It may be necessary to update the AppPermissionRequests and AppPrerequisites sections.

All app web components are in a single feature. Updating an app web means updating the manifest. The VS feature designer does not display the elements the update, so it is necessary to disable the feature designer.

Best Practice 3 : Use the same version for the feature that you use for the app. <ElementManifests> is only processed on a clean install. <UpgradeActions> is processed on both clean install and update. <CustomUpgradeActions> are not applicable to apps. Update actions should not reoccur in further versions. That is the purpose of the <VersionRange> markup.

Best Practice 4 : Do not use a BeginRange attribute. There are two ways to update the host web : descriptive markup or code. Only two kinds of components that can be deployed via markup : app part and custom action. But the good side, is that it is using a complete replace of the previous version.

Best Practice 5 : When updating an app part, change the Namr property of the ClientWebPart. Whole-for-whole replacement logic is only application when there is no risk of data loss. For provider-hosted app, the update of the remote component is a separate update of the SharePoint app.

Best Practice 6 : Changes to remote components must not break older versions of the app. For example, if the new version of the remote page introduces new features, it will be available directly to the users, but will break as not all SharePoint components will be available.

Best Practice 7 : Pass the app version number as a query to the remote page in the URL query. This is to avoid the issue of the previous point. If all the changes are on remote components, don't update the SharePoint app. When on a single-tenant provider hosted app, updates is part of the same event. An Updated Event Handler is a remote event receiver, and, using CSOM or REST can do anything. It is registered in the app manifest and executed at the end of the update process. It can provide custom logic to update remote databases or host web components.

Best Practice 8 : Catch all errors in the update event handler. Because the update infrastructure does not know about exceptions raised in the event handler. The code has to rollback the updates.

Best Practice 9 : When there is an error, the code must rollback what the update did. This is typically done in the catch block of the remote event handler. If lucky, the backup and restore mechanism can be used. But, the rollback needs to take in account that the previous version was not necessarily the latest. Therefore, more than one rollback block is required, similarly to the update path.

Best Practice 10 : If you add a component to an app in an Upgraded Event Handler handler, be sure to add the same code to an Installed Event handler. Because a component that must be deployed during an update must also be deployed during a brand new installation. But, in the full install code, there is no need for testing the version number

Thursday, 06 March 2014 21:46:21 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
SP2013 | SPC14
Ranked #1 as
French-speaking SharePoint
Community Influencer 2013
Currently Reading :
I was there :
I was there :
I was exhibiting at :
I was there :
I was a speaker at :
I was a speaker at :
I was a speaker at
(January 2013 session):
I was a speaker at :
I was a speaker at :
United Nations (UN) SharePoint Event 2011
I was a speaker at :
I was there !
I was there !
I was there !
I was there !
Archive
<2017 October>
SunMonTueWedThuFriSat
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234
Listed On :
Blogroll
[Feed] Weblogger.ch
[Feed] David Chappell :: Weblog
[Feed] RockyH - Security First!
[Feed] The Project Management Podcast™
[Feed] Lunch over IP
[Feed] Intellectual Hedonism
[Feed] Upgrade to Biztalk 2006
[Feed] BizTalk Server Team Blog
[Feed] Eric Cote
[Feed] Mario Cardinal
[Feed] BizTalk Server Performance
[Feed] Julia Lerman Blog - Don't Be Iffy...
[Feed] Dotnet Fox
[Feed] Joel on Software
[Feed] Kevin Lam's WebLog
[Feed] BizTalk 101 - Back to Basics
[Feed] Peter Himschoot's blog
[Feed] Guy Barrette
[Feed] Mark Harrison
[Feed] Chanian, Raj
[Feed] A BizTalk Enthusiast
[Feed] Kevin B Smith's WebLog
[Feed] JABLOG
[Feed] BizTalk Core Engine's WebLog
[Feed] Robert Rijsdijk's BizTalk Server Weblogs
[Feed] Bryant Likes's Blog
[Feed] {CaptainK} - a.k.a Suresh Kumar
[Feed] CaPo's .NET and Enterprise Servers adventures - by Carlo Poli
[Feed] Charles Young
[Feed] Christoph .NET
[Feed] ComputerZen.com - Scott Hanselman's Weblog
[Feed] Console.WriteLine("Hello World");
[Feed] Darrell Norton's Blog
[Feed] Darren Jefford
[Feed] Dot Net Dunk
[Feed] Gilles' WebLog
[Feed] Jan Tielens' Bloggings
[Feed] Lamont Harrington's Blog
[Feed] Lamont Harrington's Blog
[Feed] Luke Hutteman's Weblog
[Feed] Matt Meleski's .Net Blog - The ABC's of .NET
[Feed] Michael Platt's WebLog
[Feed] Mike Holdorf's Blog
[Feed] Mike Taulty's Weblog
[Feed] Neopoleon.com
[Feed] Owen Allen
[Feed] Scott Woodgate's E-Business Outbursts
[Feed] Stephen W. Thomas
[Feed] The Arch Hacker's BizTalk Blog
[Feed] The BizTalk Visionary - BizTalk 2004, SOA and on
[Feed] Trace of Thought (Scott Colestock)
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Yves Peneveyre
Sign In
Statistics
Total Posts: 286
This Year: 0
This Month: 0
This Week: 0
Comments: 18
Themes
Pick a theme:
All Content © 2017, Yves Peneveyre
DasBlog theme 'Business' created by Christoph De Baene (delarou)