Preface: This post was written a long back, but somehow it was never published and was kept in draft mode (may be, I forgot). There might be a new update process published by MS. I'm still publishing this post just to share my learning. Do google/bing for latest information on App Update.
When I was playing around SharePoint Hosted App on SharePoint Online, I observed a couple of behaviors with respect to App upgrade. So I decided to post my observations here.
Scenario:
I've created a simple SharePoint Hosted App. This app has a Client Web Part. This Client Web Part reads items from a List. This List is created in host web.
Deployment steps followed:
My Observations:
Case 1 - App Version 1.0.0.0
In this version, I'm reading top 1 item from the List. After I deploy (refer above steps) and when I refresh the page, Client Web Part is showing only one item from the List.
Case 2 - App Version 1.0.0.0
Though version is same, I modified my code to pull top 2 items from the List and I deploy this app. In my team site, Client Web Part still shows only one item and when I go to About page of my SharePoint Hosted App, there is no message that my App has changed.
So, if you change any logic in your app keeping the version number intact, it will not affect on the sites where it is already added. Also, site user will not come to know about any changes in the App.
Case 3 - App Version 1.0.0.1
I changed the "Revision" part of version number. I changed the code to read top 3 items from the List and deployed. Now here is the interesting part.
When you go to the page where Client Web Part is added, it still shows only one item. However, when you click on About link in App under Site Contents as shown below
it shows that "there is a new version of this app. Get it now".
When you click on Get It button, it prompts you to trust it.
When you trust it, upgrade starts.
Now if you go to the page where Client Web Part is added, this web part shows 3 items from the list.
Summary:
When I was playing around SharePoint Hosted App on SharePoint Online, I observed a couple of behaviors with respect to App upgrade. So I decided to post my observations here.
Scenario:
I've created a simple SharePoint Hosted App. This app has a Client Web Part. This Client Web Part reads items from a List. This List is created in host web.
Deployment steps followed:
- Package my solution in Visual Studio.
- Upload .app file to App Catalog in my SharePoint Online tenant.
- In my team site collection, add this App from "From your Organization" page.
- After adding App, navigate to any page, edit the page and Insert Client Web Part (available under App Part).
My Observations:
Case 1 - App Version 1.0.0.0
In this version, I'm reading top 1 item from the List. After I deploy (refer above steps) and when I refresh the page, Client Web Part is showing only one item from the List.
Case 2 - App Version 1.0.0.0
Though version is same, I modified my code to pull top 2 items from the List and I deploy this app. In my team site, Client Web Part still shows only one item and when I go to About page of my SharePoint Hosted App, there is no message that my App has changed.
So, if you change any logic in your app keeping the version number intact, it will not affect on the sites where it is already added. Also, site user will not come to know about any changes in the App.
Case 3 - App Version 1.0.0.1
I changed the "Revision" part of version number. I changed the code to read top 3 items from the List and deployed. Now here is the interesting part.
When you go to the page where Client Web Part is added, it still shows only one item. However, when you click on About link in App under Site Contents as shown below
About Link |
Upgrade Option |
When you click on Get It button, it prompts you to trust it.
Trust It |
Upgrade |
Now if you go to the page where Client Web Part is added, this web part shows 3 items from the list.
Summary:
- If you are making any changes to the existing App, ensure that Version is changed.
- If Version is not changed, the changes will not reflect unless user removes the App and adds again. However note that, Client Web Part also gets removed from the page.
- In this scenario, site user need to decide to go for App upgrade.
Hi Suresh,
ReplyDeleteThere are certain doubts I have regarding your post here
If you are deploying through App Catalog, it will not allow you to keep the same revision number. So I am curious to know if there is any exception to this.
Also I want to know what will be the behavior of the App while it is upgrading. Will the end user see a service unavailable page similar to SharePoint Server side upgrades or will it be different.
As I have mentioned in the post, I tried this long back. I could able to deploy to App Catalog without changing revision number. I am not sure if it has changed now. I will try and let you know.
DeleteSecond one is a great question. I have not checked this perticular scenario. Will keep this in mind when I am testing. Also do let me know if you get any findings on this.
Your app will show a message that the app is under upgrade
DeleteThanks @Anonymous for the reply.
Delete