SOLVED

Updating Provider Hosted Add-Ins

%3CLINGO-SUB%20id%3D%22lingo-sub-446400%22%20slang%3D%22en-US%22%3EUpdating%20Provider%20Hosted%20Add-Ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446400%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20VS%20solution%20for%20creating%20Provider%20Hosted%20Add-Ins%20(internal%20IIS%20server)%20for%20a%20new%20Sharepoint%20Online%20(development)%20site%20collection%2C%20but%20I'm%20having%20issues%20when%20adding%20new%20ClientWebParts.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20creating%20a%20new%20one%20in%20VS%2C%20I%20publish%20the%20web%20solution%20to%20IIS%2C%20then%20press%20F5%20to%20build%20and%20deploy%20the%20apps%20to%20Sharepoint%20Online%2C%20but%20my%20previous%20Web%20Parts%20are%20removed%20from%20any%20pages%20I%20have%20added%20them%20to.%20Is%20this%20by%20design%3F%20Is%20there%20another%20way%20I%20can%20deploy%20updates%20without%20the%20app%20being%20retracted%2Funinstalled%20first%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20to%20edit%20the%20Deployment%20Configuration%20Settings%20to%20remove%20the%20Uninstall%20SharePoint%20Add-In%20step%20but%20my%20updates%20do%20not%20get%20applied.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20278px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108456iA5589D0CFC2DE597%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%221.png%22%20title%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-446505%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Provider%20Hosted%20Add-Ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446505%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20by%20design.%20The%20solution%20creates%20a%20new%20clientId%2C%20re-packages%20and%20re-creates%20a%20new%20.app%20package%20in%20your%20site.%20During%20this%20process%20it%20re-tracts%20the%20current%20solution%20and%20installs%20the%20solution.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20only%20time%20this%20wouldn't%20be%20the%20case%20is%20if%20you%20are%20working%20on%20the%20web%20project%20files.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-446557%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Provider%20Hosted%20Add-Ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446557%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEventually%20I%20could%20have%20several%20dozen%20web%20parts%20that%20will%20be%20gradually%20built%20over%20time%20and%20added%20to%20SP%20as%20I%20go.%20It's%20not%20realistic%20to%20have%20to%20re-add%20each%20web%20part%20to%20every%20page%20at%20every%20update.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAm%20I%20going%20about%20this%20the%20wrong%20way%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-446611%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Provider%20Hosted%20Add-Ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446611%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F320168%22%20target%3D%22_blank%22%3E%40JasonBart%3C%2FA%3E%26nbsp%3BI%20would%20have%20a%20place%20where%20you%20can%20deploy%20the%20add-in%20(not%20your%20development%20environment).%20Where%20the%20web%20parts%20you%20currently%20actively%20working%20on%20can%20live.%20Think%20of%20this%20as%20your%20staging%20environment.%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20most%20scenarios%2C%20you%20are%20working%20with%201%20web%20part%20at%20a%20time%2C%20no%3F%20I%20would%20use%20your%20development%20environment%20as%20you%20are%20today.%20When%20a%20web%20part%20is%20%22done%22%2C%20just%20deploy%20the%20app%20to%20your%20tenant%20and%20install%20a%20version%20in%20a%20another%20site%20collection.%20That%20way%20you%20can%20always%20have%20a%20configured%20site%2C%20with%20configured%20web%20parts.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EOn%20a%20side%20note%2C%20is%20there%20any%20reason%20you%20are%20using%20Add-Ins%20instead%20of%20using%20the%20SharePoint%20Framework%3F%20Not%20that%20add-ins%20are%20going%20away%20right%20now%2C%20but%20SharePoint%20Framework%20is%20a%20much%20better%20way%20to%20implement%20web%20parts%20in%20SharePoint%20Online%2C%20that%20work%20both%20in%20classic%20and%20modern%20pages.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-446709%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Provider%20Hosted%20Add-Ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446709%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20on%20one%20at%20a%20time%20usually%2C%20but%20they%20are%20just%20small%20ASP%20WebForms%20that%20display%20data%20from%20our%20internal%20databases%20(calendars%2C%20grids%2C%20charts%2C%20etc)%20so%20I%20can%20knock%20out%20a%20few%20a%20week.%20I'm%20not%20excited%20about%20being%20stuck%20using%20IFrames%20but%20I%20have%20been%20able%20to%20make%20it%20work.%20I'm%20not%20interested%20in%20using%20built-in%20SP%20lists%2C%20forms%2C%20etc.%20which%20is%20why%20I%20didn't%20think%20client%20side%20SPFx%20would%20work%20for%20us.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20sure%20how%20having%20a%20second%20dev%20site%20(has%20to%20be%20dev%20site%20to%20side-load%20apps%2C%20correct%3F)%20would%20help.%20We%20are%20only%20dedicating%20(1)%20site%20to%20our%20internal%20business%20data%20pages.%20Maybe%20I%20can%20break%20the%20web%20parts%20up%20into%20seperate%20apps%2C%20but%20that%20means%20having%20multiple%20IIS%20virtual%20directories%20which%20sounds%20messy.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-451471%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Provider%20Hosted%20Add-Ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-451471%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F320168%22%20target%3D%22_blank%22%3E%40JasonBart%3C%2FA%3E%26nbsp%3BThe%20reason%20I%20ask%2C%20is%20that%20SPFx%20has%20built%20in%20support%20for%20third%20part%20web%20APIs.%20If%20your%20company%20is%20planning%20on%20expanding%20how%20much%20data%20you%20bring%20into%20your%20environment%2C%20you%20may%20start%20thinking%20about%20using%20SPFx%20%2B%20a%20Web%20API%20to%20grab%20the%20content.%3CBR%20%2F%3E%3CBR%20%2F%3EGenerally%20speaking%20the%20Provider%20Hosted%20Add-In%20model%20is%20quite%20clunky%2C%20and%20obviously%2C%20having%20to%20develop%20in%20IFrames%20is%20a%20huge%20pain.%20Using%20SPFx%20and%20the%20AADHttpClient%2C%20you%20could%20build%20your%20Web%20API%20that%20does%20all%20of%20your%20on-premises%20data%20access%2C%20while%20at%20the%20same%20time%20building%20your%20web%20parts%20in%20a%20modern%20framework%20like%20SPFx%20-%20giving%20you%20the%20best%20of%26nbsp%3B%20both%20worlds%3B%20On-premises%20data%20access%20and%20responsive%2Fmodern%20web%20parts%20w%2Fout%20Iframes.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Deleted
Not applicable

 

I have a VS solution for creating Provider Hosted Add-Ins (internal IIS server) for a new Sharepoint Online (development) site collection, but I'm having issues when adding new ClientWebParts.

 

After creating a new one in VS, I publish the web solution to IIS, then press F5 to build and deploy the apps to Sharepoint Online, but my previous Web Parts are removed from any pages I have added them to. Is this by design? Is there another way I can deploy updates without the app being retracted/uninstalled first?

 

I have tried to edit the Deployment Configuration Settings to remove the Uninstall SharePoint Add-In step but my updates do not get applied.

 

1.png

5 Replies
Highlighted
Best Response
Solution

This is by design. The solution creates a new clientId, re-packages and re-creates a new .app package in your site. During this process it re-tracts the current solution and installs the solution.

The only time this wouldn't be the case is if you are working on the web project files. 


Highlighted

 

Eventually I could have several dozen web parts that will be gradually built over time and added to SP as I go. It's not realistic to have to re-add each web part to every page at every update.

 

Am I going about this the wrong way?

 

Highlighted

@Deleted I would have a place where you can deploy the add-in (not your development environment). Where the web parts you currently actively working on can live. Think of this as your staging environment.  

In most scenarios, you are working with 1 web part at a time, no? I would use your development environment as you are today. When a web part is "done", just deploy the app to your tenant and install a version in a another site collection. That way you can always have a configured site, with configured web parts. 

On a side note, is there any reason you are using Add-Ins instead of using the SharePoint Framework? Not that add-ins are going away right now, but SharePoint Framework is a much better way to implement web parts in SharePoint Online, that work both in classic and modern pages. 

Highlighted

I am working on one at a time usually, but they are just small ASP WebForms that display data from our internal databases (calendars, grids, charts, etc) so I can knock out a few a week. I'm not excited about being stuck using IFrames but I have been able to make it work. I'm not interested in using built-in SP lists, forms, etc. which is why I didn't think client side SPFx would work for us. 

 

I'm not sure how having a second dev site (has to be dev site to side-load apps, correct?) would help. We are only dedicating (1) site to our internal business data pages. Maybe I can break the web parts up into seperate apps, but that means having multiple IIS virtual directories which sounds messy.

 

Highlighted

@Deleted The reason I ask, is that SPFx has built in support for third part web APIs. If your company is planning on expanding how much data you bring into your environment, you may start thinking about using SPFx + a Web API to grab the content.

Generally speaking the Provider Hosted Add-In model is quite clunky, and obviously, having to develop in IFrames is a huge pain. Using SPFx and the AADHttpClient, you could build your Web API that does all of your on-premises data access, while at the same time building your web parts in a modern framework like SPFx - giving you the best of  both worlds; On-premises data access and responsive/modern web parts w/out Iframes.