<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkcHSXw8eip7ImA9WhBbF04.&quot;"><id>tag:blogger.com,1999:blog-4126985520350746834</id><updated>2013-05-16T22:00:38.272+01:00</updated><category term="Personal" /><category term="Coding" /><category term="WCM" /><category term="Continuous Integration" /><category term="jQuery" /><category term="master pages" /><category term="debugging" /><category term="speaking" /><category term="workflow" /><category term="page layouts" /><category term="JSLink" /><category term="security" /><category term="lists" /><category term="deployment" /><category term="SharePoint" /><category term="AJAX" /><category term="SP2013" /><category term="content deployment" /><category term="ghosting" /><category term="codeplex" /><category term="Search" /><category term="help" /><category term="Content Search web part" /><category term="TechEd" /><category term="customizing" /><category term="Virtual Server" /><category term="CAS policy" /><category term="site definitions" /><category term="user group" /><category term="CustomAction" /><category term="SP2010" /><category term="feature-stapling" /><category term="Content Deployment Wizard" /><category term="webparts" /><category term="feature receiver" /><category term="site columns" /><category term="configuration" /><category term="features" /><category term="central admin" /><category term="DelegateControl" /><category term="MOSS" /><category term="content migration API" /><category term="VSeWSS" /><category term="Virtual Machine Manager" /><category term="content query web part" /><category term="content types" /><category term="InfoPath" /><title>Chris O'Brien</title><subtitle type="html">The nuts and bolts of SharePoint.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.sharepointnutsandbolts.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.sharepointnutsandbolts.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/4126985520350746834/posts/default?start-index=2&amp;max-results=1&amp;redirect=false&amp;v=2" /><author><name>Chris O'Brien</name><uri>http://www.blogger.com/profile/10022906552670607366</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_DPonmXhJQ4g/SiFZBcX_Q1I/AAAAAAAAAa0/14b7VTN0FZM/s1600-R/28f5735.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>163</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>1</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ChrisObrien" /><feedburner:info uri="chrisobrien" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;A0UDSXk_eyp7ImA9WhBUGUs.&quot;"><id>tag:blogger.com,1999:blog-4126985520350746834.post-5502265772370838064</id><published>2013-05-08T00:22:00.000+01:00</published><updated>2013-05-08T00:27:58.743+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-08T00:27:58.743+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SP2013" /><title>Azure is the new SharePoint ‘layouts’ directory</title><content type="html">&lt;p&gt;SharePoint developers have always had a need to store files in a central location that can be accessed/shared from ALL SharePoint sites. This is often needed for supporting files such as images, CSS and JavaScript - usually we don’t want such files to exist in each individual site, because when updates are needed we might then have 10,000 different places to update the file. As you can imagine, there are other reasons to avoid this duplication too. &lt;/p&gt;  &lt;p&gt;One long-established way of working around this is to deploy such files to the server filesystem, rather than into a specific SharePoint site. Commonly, the ‘_layouts’ folder under SharePoint root directory (i.e. ‘14’ for SharePoint 2010 or ‘15’ for SharePoint 2013) was used for such shared files. A second method involved deploying files as ‘uncustomized’, or ‘GhostableInLibrary’. This works by adding a list item ‘stub’ for the file into each site or library, but since the file is also deployed to the SharePoint server’s filesystem, the file &lt;em&gt;contents&lt;/em&gt; are pulled from there. In the content database, the SQL record literally has a pointer to the location of the physical file on the SharePoint server (again, this would be somewhere under SharePoint root directory).&lt;/p&gt;  &lt;h3&gt;Cloud says no&lt;/h3&gt;  &lt;p&gt;Once you start to develop sandboxed solutions or SharePoint 2013 apps, of course the technique above cannot be used. Files cannot be provisioned to the server filesystem, since the servers might not belong to you – in the case of Office 365, the servers are run by Microsoft. So what can we do? &lt;/p&gt;  &lt;p&gt;Well, something I’m sure I’m not the first to think of is that if the production servers are connected to the internet (and cloud services like Office 365 always are), then you can just store your images, CSS and JavaScript files on some other servers (or service), and your pages will run just fine. For what it’s worth, &lt;strong&gt;I’ve been doing this on my blog site for quite a while – &lt;/strong&gt;if you go looking, you’ll see I have some CSS and JavaScript being loaded ‘across the internet’ from &lt;a href="http://sharepointnutsandbolts.azurewebsites.net"&gt;http://sharepointnutsandbolts.azurewebsites.net&lt;/a&gt; rather than &lt;a href="http://www.sharepointnutsandbolts.com"&gt;http://www.sharepointnutsandbolts.com&lt;/a&gt;.&amp;#160; Like me, you might find that Azure is a good choice here – it’s a solid offering with several flavors (I use the free version), and numerous options exist for getting your files there (FTP, WebDeploy, continuous deployment from TFS/Git etc.). Of course, any similar cloud service would work fine too – as indeed might some on-premises non-SharePoint &lt;strong&gt;servers &lt;/strong&gt;(rather than service) you supply. Just remember that with that latter option, you’d need to take care of high-availability, backup/restore, maybe load-balancing etc. Thanks to Azure, I can let Microsoft deal with that :)&lt;/p&gt;  &lt;p&gt;As you can imagine, we now regain the ability to store a single instance of files, even if not on the SharePoint server itself. To illustrate, here’s what the ‘default’ and ‘centralized’ approaches look like in pictures:&lt;/p&gt;  &lt;h4&gt;Default app/sandboxed development model:&lt;/h4&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-dn2hRssWZE4/UYmMwHRO1fI/AAAAAAAACOM/F_n9WAGBSDo/s1600-h/Azureforstoringappfiles2.png"&gt;&lt;img title="Azure for storing app files 2" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Azure for storing app files 2" src="http://lh4.ggpht.com/-FM624Wt-jRY/UYmMx27b83I/AAAAAAAACOU/QR1RxYY_Vn0/Azureforstoringappfiles2_thumb5.png?imgmax=800" width="714" height="325" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h4&gt;Centralized development model:&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-6Ao6Fg6zeXE/UYmMzJigZTI/AAAAAAAACOc/f1LoUI1QPJs/s1600-h/Azure%252520for%252520storing%252520app%252520files%25255B12%25255D.png"&gt;&lt;img title="Azure for storing app files" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="Azure for storing app files" src="http://lh6.ggpht.com/-14X23cI82mQ/UYmM1PQ4JzI/AAAAAAAACOk/Wi9Ur_ZDGow/Azure%252520for%252520storing%252520app%252520files_thumb%25255B6%25255D.png?imgmax=800" width="805" height="429" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;When should I be considering this?&lt;/h3&gt;  &lt;p&gt;I think this broad approach is relevant to the following scenarios:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Developing sandboxed solutions&lt;/li&gt;    &lt;li&gt;Developing SharePoint-hosted apps&lt;/li&gt;    &lt;li&gt;Developing auto-hosted apps&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The scenario I’ve left out is &lt;strong&gt;provider&lt;/strong&gt;-hosted apps. This is because here your supporting images, CSS and JavaScript files are stored outside of SharePoint anyway – and by default are stored as a single instance. After all, a provider-hosted app is just a &lt;em&gt;non-SharePoint website &lt;/em&gt;at the end of the day. Auto-hosted apps are perhaps an interesting case because the app’s supporting files are deployed to Azure, but the same deal applies – they are not shared between app instances.&lt;/p&gt;  &lt;p&gt;If you are working in these models and not currently considering this approach, perhaps you should. Yes, it can make the initial development process more complex (since your app is effectively stored in multiple places), but rolling out updates once in production will most likely be much simpler. Even if you don’t like this idea, then at least ensure you’ve considered your update mechanisms for these files.&lt;/p&gt;  &lt;p&gt;An interesting observation (if it hadn’t occurred to you already), is that provider-hosted apps are &lt;em&gt;mainly &lt;/em&gt;stored outside SharePoint – including their business logic. This means, amongst other things, that the creator has the option of making fairly big changes to the app &lt;em&gt;without requiring the app to be upgraded or resubmitted to the Store.&lt;/em&gt; Certainly worth bearing in mind.&lt;/p&gt;  &lt;h3&gt;Further considerations&lt;/h3&gt;  &lt;p&gt;I think the following also need to be considered:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font color="#000000"&gt;&lt;strong&gt;Versioning&lt;/strong&gt;&lt;/font&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;font color="#000000"&gt;You’ll most likely need to provide some form of versioning of your “remotely-stored” CSS and JavaScript files, for example storing them under folders named “v1”, “v2” or “1.0.0.0”, “2.0.0.0” etc. This will allow you to deploy updates for later versions of your apps, whilst maintaining the original experience for users/sites who do not upgrade&lt;/font&gt;&lt;/li&gt;      &lt;li&gt;&lt;font color="#000000"&gt;Remember also that if you &lt;strong&gt;did&lt;/strong&gt; want to make changes to existing CSS/JS files, these will most likely be cached at the browser for existing users. So you may need to do something to bust the cache (as discussed for non-app scenarios in &lt;a href="http://www.sharepointnutsandbolts.com/2011/11/avoiding-bugs-from-cached-javascript.html" target="_blank"&gt;Avoiding bugs from cached JavaScript and CSS files in SharePoint&lt;/a&gt;), but remember also that changes to the URL used will require changes/upgrades to the app itself unless the page is provider-hosted&lt;/font&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;font color="#000000"&gt;&lt;strong&gt;Alternative storage flavors:&lt;/strong&gt;&lt;/font&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;font color="#000000"&gt;Although I’ve mainly discussed storing files in simple Azure websites, my colleague Salvatore di Fazio has also considered the use of Azure CDN –see his post &lt;/font&gt;&lt;a title="Sharepoint 2013 – How to share contents between Apps" href="http://salvatoredifaziosharepoint.blogspot.co.uk/2013/03/sharepoint-2013-how-to-share-contents.html"&gt;Sharepoint 2013 – How to share contents between Apps&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;img src="http://feeds.feedburner.com/~r/ChrisObrien/~4/-mAVtT046Kc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepointnutsandbolts.com/feeds/5502265772370838064/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4126985520350746834&amp;postID=5502265772370838064" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4126985520350746834/posts/default/5502265772370838064?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4126985520350746834/posts/default/5502265772370838064?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ChrisObrien/~3/-mAVtT046Kc/azure-is-new-sharepoint-layouts.html" title="Azure is the new SharePoint ‘layouts’ directory" /><author><name>Chris O'Brien</name><uri>http://www.blogger.com/profile/10022906552670607366</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_DPonmXhJQ4g/SiFZBcX_Q1I/AAAAAAAAAa0/14b7VTN0FZM/s1600-R/28f5735.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-FM624Wt-jRY/UYmMx27b83I/AAAAAAAACOU/QR1RxYY_Vn0/s72-c/Azureforstoringappfiles2_thumb5.png?imgmax=800" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://www.sharepointnutsandbolts.com/2013/05/azure-is-new-sharepoint-layouts.html</feedburner:origLink></entry></feed>
