Category Archives: Office 365

Subscriptions for Office and SharePoint apps arrive

One of the biggest issues for developers they face today with various app eco-systems is how to build an on going revenue stream.  This is the problem mobile developers face and why many mobile marketplaces have introduced in app purchases.

In the business world this is even more of a problem. Typically the apps are a lot more complex and require big investment to build, maintain and improve over time. It is simply not possible to build a business model on a single one time payment when someone buys an app.

What app builders need is an on going revenue stream via a subscription model.  It has been by far and away the most asked for revenue feature in the Office/SharePoint store.

Starting today that is possible. Here is the announcement.

The long and short of it is app developers can submit or update their apps to use the subscription model.  As of writing the store doesn’t seem to be offering subscriptions, but i suspect its going live shortly.

Update:  It looks like the only subscription option will be per user per month. Not yearly or something like per tenant per month/year etc…

The implications of this are HUGE.  I have heard from many people who are just not interested in building apps unless they have subscriptions. To date only ISVs with decent size and resources have been able to work around this store limitation by building their own commerce model and do their commerce and licensing outside of the store (which is allowed).  Nintex recently launched Nintex Workflow for Office 365 which does this. Licensing is managed outside of the store and they manage the subscriptions etc… This is also handy because they can deal with much more complex subscription types such as pricing tiers etc…  Managing your own subscriptions is nice because you have full control, but with it comes the complexity of doing all the commerce etc… Also by doing the commerce outside of the store you are not giving MS the 30% cut from your app sales.

I am really interested to see what other ISVs now pull the trigger and start offering apps in the store now we have this capability.  I suspect the big ISVs wont be using the store commerce model anyway … but i would expect to see some smaller ISVs coming to the party soon. 


Launching SharePoint Apps, launch sequence, debugging and AppRedirect.aspx

Writing SharePoint Apps can be tricky at times. Especially until you learn to know where to look when things are not working for you. Usually the first issue people strike is trying to launch their app and it not working.

Usually one of the first errors people strike is a common one that has an error that says “The parameter ‘token’ cannot be null or empty string”.


This is a signal that something went wrong launching the application and that some of the information that is passed to SharePoint during the app launch wasn’t passed correctly.  Usually due to an app setup issue.

The particular error above could be caused by a variety of issues, however the point of this post is to show you the first place I look when trying to debug it.  Hopefully this will help others find and fix their problem too.

First, to understand where to look when debugging its important to understand the process of what happens when you are launching a SharePoint App. The basic steps of the launch process are:

  1. User clicks the app to launch it
  2. SharePoint sends the user to the AppRedirect.aspx telling it what app to launch
  3. AppRedirect.aspx builds a set of launch parameters including a context token and other parameters about the SharePoint site launching the app e.g. SPSiteUrl
  4. AppRedirect.aspx renders a page with these parameters as a hidden HTML form on the page
  5. Javascript runs that submits the form to the applications launch page, POSTing these form parameters along with some query string parameters
  6. The App page is called and can get these parameters from the Request and use them as it needs. e.g. for using the CSOM to call back to SharePoint.

The error shown above is a snippet of boilerplate code from a provider hosted app code template in Visual Studio.  In order to construct the CSOM context the classes in TokenHelper.cs that are used need some of the information passed in the POST parameters from AppRedirect.aspx.  These are not on the query string as they are POST parameters, so this is usually where people get stuck debugging.  You need to use a tool like Fiddler to see the POST being made and take a look at it.

Below is what the launch sequence looks like in Fiddler (click on the image to get a bigger version):


  1. AppRedirect.aspx is called and the launch parameters are constructed and the Form is submitted by the browser.
  2. The app page is called, in this case Default.aspx
  3. My app wants to make a call using the CSOM to SharePiont and as part of that needs an OAuth Access Token, so is reuqesting one from Azure Access Control Services (ACS) (topic for another post).
  4. Finally the CSOM query is processed and the call to ProcessQuery is made.

In the browser you will recognize the AppRedirect.aspx page by the infamous “Working on it…” text 🙂

If you open #1 above in Fiddler in the raw response to the browser you will see the following:


This is the HTML Form with the launch parameters included. 

If the SPAppToken is empty … you have a launch problem 🙂

If your form is missing the SPAppToken then you will get the error message at the beginning of those post. It’s got the context token that you need in order to use the CSOM.

If it’s empty in the Form you likely have an error message in the SPErrorInfo giving your some more information about why is null/empty.

SPErrorInfo is your first place to start looking for why things are not working.

This should provide some insight and more pointers on where to look next.

E.g. “The Azure Access Control service is unavailable”.   This message says that SharePoint can’t construct the SPAppToken because it cant talk to ACS in order to do that.  This could be for a variety of reasons, such as network connectivity.

This post wasn’t written to solve every problem you have with launching an app.  It was posted to help those trying to debug their apps.  I thought it would be useful for those wanting tips on where to look to find some information when they are having issues launching their app.

I hope to helps!


Yammer and Office 365 integration gets tighter

Microsoft has been talking about faster releases in Office 365 and getting functionality out to its customers on a cadence they are not used to with on-prem software.  It’s great to see this happening albeit too slowly for some people.

Today is another example of small but important steps forward.

Christophe from the SharePoint team just posted about a new improvement in Office 365 that lets you comment on a document that lives in Office 365 and have that comment land in Yammer.

We had built an app called Share-It for Office 365 that does this, albeit in a less sophisticated manner.  You can read about that here:

Although I’m sad that Share-It for Office 365 in its current form has been superseded we have some new plans for Share-It that I hope to be able to talk about shortly deepening the integration options between the two system.  I can’t say i am upset they did this at all, after all the idea from Share-It actually came from the work I did with the SharePoint team during the last SharePoint Conference and it was very clear that eventually this same functionality would be baked in. It was no surprise at all.

It’s awesome to see the two getting small but important improvements like this!  Well done MS.

Read Christophe’s post here:


Extending your Azure AD tenant to include Office 365 services

I learnt something today that I thought would be interesting to share in the hope someone else won’t need to do the research.

Say you already have Windows Intune or Azure AD already up and running and now you are ready to give Office 365 a go.

You have a couple of choices:

  1. Create a new Office 365 tenant
  2. Extend your existing Azure AD tenant and add Office 365 services.

The correct way to do things is to Extend your existing tenant and add Office 365 services.  If you have Azure AD already you are likely DirSync to push all your user accounts from your on-prem AD to Azure AD.  It makes sense that those are the same users you want to access Office 365 no doubt.

If you try and create a new tenant and then do DirSync to that tenant you will most likely hit issues with trying to push the same users to two different Azure AD tenants.

Extending is the way to go.

If you sign into the Office 365 management portal using your current credentials you use for Azure AD/Intune you will see a page like this:


You will notice it is saying that you are not currently subscribed to any Office 365 services.

So how do you go about adding those?

Jump over to the “purchase services” tab in the left navigation and you will get a selection of the various plans (aka SKUs) available.  In my case I picked the E3 –Trial.


This will then add the services included to your tenant. Once provisioning is complete you can carry on with the other tasks you might like to do like setting up Identity Federation (ADFS) etc…

It seems blatantly obvious now I have tried this and this is possibly hardly worth a blog post, but until now I had always started from the Office 365 side of things and had never looked at starting with Azure AD and adding Office 365.

Turns out to be dead simple 🙂


More Office 365 storage improvements

Back in March I posted about Office 365 Exchange Online’s online archive features and how great they are for keeping up to 100GB of mail.  Take a read of that here: Exchange online archive awesomeness

This today and earlier this week we saw a couple of announcements from Microsoft around storage and capacity improvements in a couple of key Office 365 areas.

1. SkyDrive Pro.  This gets a bump to 25GB of storage by default. Previously it was 7GB per user.  This is pretty nice for those like me who use SkyDrive Pro to stash their files.  Also you are not limited to 25GB, your Office 365 administrator can bump it up to 100GB too.

2. Exchange Online. Microsoft just bumped the capacity of peoples inboxes to 50GB max.  Time to get my inbox size increased!

It has been really interesting watching the gradual increase in storage quotas along with price drops in the Office 365 service. Back in April 2013 there was a significant set of changes in the SharePoint Online service that increased the tenant storage limits to 25TB! What was more impressive and in my opinion really made SharePoint online A LOT more affordable was the price drop that went with it. 92% reduction from $2.50 USD to $0.20 per GB.  That meant customers with a lot of data who were considering moving from SharePoint on-premises are far less likely to get hung up on price than they previously were.  With a number of pain points likely to make a move like that hard, price was a no brainer to get rid of.

I guess this really shouldn’t be much of a surprise given the cost of storage these days. But these improvements don’t primarily come from that ever decreasing costs of storage drop.  They primarily come from Microsoft getting better and better are running the Office 365 service and bringing their internal COGs (Cost of Goods) down and passing along those savings to customers.

This is great news for both current users of the Office 365 service and future customers alike.


Sharepoint Provider Hosted Apps in Azure monitoring tip

One of the tips I gave to during my session at TechEd North America this year was about using SignalR in your SharePoint provided hosted applications in Azure.

One of the pain points for developers and people creating provider hosted apps is monitoring them when they are running in the cloud. This might be just to see what is happening in them, or it might be to assist with debugging an issue or bug.

SignalR has helped me A LOT with this.  It’s a super simple to use real time messaging framework. In a nutshell it’s a set of libraries that let you send and receive messages in code, be that in JavaScript or .Net code.

So how do I use it in SharePoint provider hosted apps in Azure to help me monitor and debug?

A SharePoint Provider Hosted App is essentially a web site that provides parts of your app that surface in SharePoint through App Parts or App Pages etc… It’s a set of pages that can contain code behind them as any regular site does.  It’s THAT code that runs that I typically want to monitor while its running in the Azure (or anywhere for that matter).

So how does this work with SignalR?

SignalR has the concept of Hubs that clients “subscribe” to and producers of messages “Publish” to.  In the diagram below App Pages code publish or produce messages (such as “there was a problem doing XYZ”) and consumers listen to a Hub and receive messages when they are published.


In the example I gave at TechEd I showed a SharePoint Provider Hosted App deployed in Azure that Published messages whenever anyone hit a page in my app.  I also created a “Monitor.aspx” page that listened to the Hub for those messages from JavaScript and simply wrote them to the page in real-time.

How do you get this working? It’s pretty easy.

Part 1: Setting up a Hub and publishing messages

First add SignalR to your SharePoint Provider Hosted app project from Nuget. Click the image below for a bigger version showing the libraries to add.


Then in your Global.asax.cs you need to add a Application_OnStart like this.  It registers SignalR and maps the hub urls correctly.

protected void Application_Start(object sender, EventArgs e)
    // Register the default hubs route: ~/signalr

Note: You might not have a Global.asax file in which case you will need to add one to your project.

Then you need to create a Hub to publish messages to and receive them from.  You do this with a new class that inherts from Hub like this:

public class DebugMonitor : Hub
    public void Send(string message)

This provides a single method called Send that any code in your SharePoint Provider Hosted app can call when it wants to send a message. I wrapped this code up in a short helper class called TraceCaster like this:

public class TraceCaster
        private static IHubContext context = GlobalHost.ConnectionManager.GetHubContext<DebugMonitor>();
        public static void Cast(string message)

This gets a reference to the Hub called “context” and then uses that in the Cast method to publish the message.  In code i can then send a message by calling:

TraceCaster.Cast(“Hello World!”);

That is all there is to publishing/sending a simple message to your Hub. 

Now the fun part … receiving them 🙂

Part 2: Listening for messages

In my app I created a new page called Monitor.aspx. It has no code behind, just client side JavaScript. In that code it first references some JS script files: JQuery, SignalR and then the generic Hubs endpoint that SignalR listens on.

<script src=”/Scripts/jquery-1.7.1.min.js” type=”text/javascript”></script>
<script src=”/Scripts/jquery.signalR-1.1.1.min.js” type=”text/javascript”></script>
<script src=”/signalr/hubs” type=”text/javascript”></script>

When the page loads you want some JavaScript that starts listening to the Hub registers a function “addMessage” that is called when the message is sent from the server.

$(function () {
    // Proxy created on the fly         
    var chat = $.connection.debugMonitor;

    // Declare a function on the chat hub so the server can invoke it         
    chat.client.addMessage = function (message) {

        var now = new Date();
        var dtstr = now.format(“isoDateTime”);

        $(‘#messages’).append(‘[‘ + dtstr + ‘] – ‘ + message + ‘<br/>’);

    // Start the connection
    $.connection.hub.start().done(function () {
        $(“#broadcast”).click(function () {
            // Call the chat method on the server

This code uses the connection.hub.start() function to start listening to messages from Hub.  When a message is sent the addMessage function is fired and we can do whatever we like with it. In this case it simply adds it to an element on the page.

All going well when you are running your app you will be able to open up Monitor.aspx and see messages like this flowing:


If you don’t see messages flowing you probably have a setup problem with SignalR.  The most common thing I found when setting this up was the client not being able to correctly reference the SignalR JS or Hub on the server.  Use the developer tools in IE or Chrome (or Fiddler) to check that the calls being made to the server are working correctly (see below for what working should look like):


If you are sitting there thinking “What if I am not listening for messages? What happens to them?” I hear you say!  Well, unless someone is listening for the messages they go away. They are not stored. This is a real-time monitoring solution. Think of it as a window into listening what’s going on in your SharePoint Provider Hosted app.

There are client libraries for .Net, JS, iOS, Android too. So you can publish and listen for messages on all sorts of platforms.  Another application i have used this on is for simple real time communication between Web Roles in Azure and Web Sites in Azure.  SignalR can use the Azure Service Bus to assist with this and its pretty simple to set up.


I’m an developer from way back when debugging meant printf.  Call me ancient but I like being able to see what is going on in my code in real time. It just gives me a level of confidence that things are working the way they should.

SignalR coupled with SharePoint Provided Hosted Apps in Azure are a great combination.  It doesn’t provide a solution for long term application logging, but it does provide a great little realtime windows into your app that I personally love.

If you want to learn more about SignalR then I suggest you take a look at where you will find documentation and videos on other uses for SignalR.  It’s very cool.

Do I use it in production? You bet!  I use it in the backend of my Windows Phone and Winodows 8 application called My Trips as well as in SharePoint Provider Hosted Apps in Azure. Here is a screen shot from the My Trips monitoring page, I can watch activity for various devices registering with my service etc…


Happy Apping…


SkyDrive Pro naming quandary and the mess of MS file sync products

Today Mary Jo Foley wrote a piece about Microsoft losing the fight with British Sky Broadcasting Group over the name SkyDrive and in particular (as I understand it) in the “Sky” part of that.

Microsoft to rebrand SkyDrive after losing trademark skirmish – Mary Jo Foley – ZD Net

In that article she also mentions that this will likely effect the SkyDrive Pro product naming also.  Which perked my ears up given its SharePoint linkage.

I never liked the SkyDrive Pro name.  Why?  Primarily because it makes it sound like it has something to do with SkyDrive and cloud storage.  When in reality you can use SkyDrive Pro to sync files from your on-prem SharePoint system … which doesn’t feel particularly “Sky” or “Cloudy” to me!  It just confuses everyone I speak with.

I can see what Microsoft were trying to achieve with regards to Office 365 and syncing files … it makes a little more sense in that regard.  However, I always had a problem with it “hooking” on to the consumer brand of SkyDrive. They are 100% totally separate products, no technical similarities etc… The only similarity is that they sync files to your PC from somewhere.

I actually think having to rename SkyDrive is a blessing in disguise for Microsoft.

Now is the perfect time to get it right and clear up all the confusion!

To make naming and technology matters worse Windows Server 2012 R2 is introducing a feature called “Work Folders” which enables access to on-prem file shares remotely. The reason being that 1000s of customers have files in shares and will continue to do so & therefore it would be good to have access to those remotely.  You can read about Work Folders here: Introducing Work Folders on Windows Server 2012 R2  It’s actually a pretty nifty solution.

SO!  Now we currently have:

  • SkyDrive Pro – which allows you to sync files from Office 365 and from SharePoint on-prem.
  • Work Folders – which allows you to access files from file shares on-prem.

Do you see where I am going with this?

Wouldn’t it be sensible for Microsoft to release ONE Enterprise grade file sync/access tool that let you access files from Office 365, SharePoint on-prem and file shares on-prem?

I call it “Files”.  Users would never see that name however as it would show up branded/renamed in Explorer, iOS, Windows 8 and Windows Phone using the organizations logo and name e.g. “Contoso Files”.

Currently here is what i see in Explorer:


Here is what I want to see in Explorer:


In that one location you would see a list of “folders” that either belong in SharePoint on-prem, Office 365 or Work Folders (file shares on prem).


Is this really too much to ask for?

I don’t think so 🙂

With branding up in the air it would be a good time to strike and fix the mess up. However, I suspect it will take a while for this to happen and we are likely to see a name change first in the coming weeks/month (after all its a Select All replace right?! :)) and a consolidated product down the line (all fingers crossed).

What do you think should happen? or what would you like to see from Microsoft to make your file sync and management simpler?


ShareIt for Office 365 is published

imageMy previous post “Integrating SharePoint Online and Yammer – an app for that!” talked about an app we were building that would help you post a document that lives in SharePoint to Yammer.  The document stays in SharePoint but a link to the document is posted to Yammer where the conversation and discussion about it can continue i a highly collaborative setting.

ShareIt for Office 365 just hit the marketplace.  For free! If you use Office 365 and Yammer then this is a must have tool for your site.

It’s really simple to use.  Select a document and click Post to Yammer.


We have a raft of enhancements that we are hoping to make to the product over the next few months.

You can find out more about the app in the Office marketplace here:

As always feel free to get in touch with me on twitter @LoungeFlyZ if you have any questions.



Integrating SharePoint Online and Yammer – An app for that!

Way back at SPC12 (Nov 2012) the keynote included a demo that showed an example of the integration possible between SharePoint Online and Yammer that could be done with a little bit of development effort. I built that demo and decided to turn it into a real app anyone could use.

Some Background first: This surfaced in SharePoint Online by way of a new ribbon button that when pressed posted the selected document to Yammer via the Yammer Open Graph API.  It was shown pretty quickly and it was pretty easy to miss.  However, it demonstrated a few interesting methods of integration that are possible today using the new SharePoint App plumbing and Yammers pretty decent set of APIs.

The basic flow

1. In a document library a document was selected like this


2. Then in the ribbon a new “Post to Yammer” button showed up


3. When it was clicked it posted to the Yammer activity feed. 


The image above shows the hover over the activity. 

The activity feed shows a scrolling history of activity in the the Yammer network.  e.g. “Chris Johnson updated Product Catalog.docx”.  Its like that thing in Facebook that shows you all the music that your mates are listening to that they probably don’t know they are publishing to all their friends via spotify.  More on the Activity feed a little later on.

4. Clicking on the activity will take you a page in Yammer for that activity where you can Be Social™ and discuss the document, like it etc…


How it’s made

This app is pretty simple.  It’s a SharePoint Provider hosted application running in Azure Websites.  The SharePoint part of the app includes some xml to add the ribbon button to all document libraries.  When the user clicks the “Post to Yammer” button it sends some details about the document(s) to the backend of the app running in Azure. The backend code then uses the CSOM to call back into SharePoint to retrieve the name of the document and some other properties. Then the app directs the user through the Yammer OAuth authentication flow.  Once this is complete the app then is able to access Yammer on behalf of the user that signed in.

Finally the posting of the information includes posting to the Yammer activity stream using the OpenGraph APIs (JSON/REST based). It will also post to the main feed in Yammer too via the Messages REST API in Yammer. Both of these are easy to use and are fairly standard XML/JSON/REST based services.


Why is this interesting?

Recently there has been a bunch of noise about SharePoint’s current dual headed social story. 

  • In the red corner you have the social features in SharePoint (both on-prem and SharePoint Online)
  • In the blue corner you have Yammer.

The problem is that right now there is much consternation about how they don’t work nicely together. Things seem to be happening too slowly for some people.  The products are currently not integrated all that well. That is slowly changing, like the ability to switch from the NewsFeed to Yammer in Office 365 that rolled out the day of writing this post.  Those improvements will continue over time and eventually I think we will see the ability to totally replace the current out of the box social features with Yammer.

How on earth people think Microsoft can magically mash together one product with another overnight and make it all work perfectly is beyond me. It will take time people! Just because you think you could have done in overnight doesn’t mean it works that way in huge software projects … better stop this rant now before i get carried away.

The short story is that right now you have to pick one or the other.  My vote is firmly in the Yammer category. But at the end of the day there are many factors that will go into your decision either way and there isn’t a perfect answer.

There is no doubt that Microsoft will integrate the two products more deeply.  This could come in a variety of flavors including:

  • surfacing stuff that happens in Yammer in SharePoint more seamlessly (short term strategy),
  • totally replacing the existing SharePoint social features with ones backed by the Yammer in the cloud (more likely and what I would put money on, maybe with the ability to use the old stuff if you can’t use a cloud service)

Back to why this integration is interesting…

You can do things today to help with this situation.  The demo showed a very basic example of some custom integration using things we know exist today.

I smell a set up!

… and you would be right.  We are going to release this app to the store so that anyone with Office 365 can use it.  It needed some tweaks to make it work well in production & some branding changes. However in the coming days/weeks we will release it under the name “ShareIt”.


I am going to write a future post on how this app was created and it will include code to illustrate how to call the Yammer APIs.

Ultimately you should be able to follow along and learn about how you can leverage the SharePoint App model + Yammer APIs to help integrate the two products while we wait for MS to offer a nice compelling seamless integration at a yet to be determined point in time 🙂

Note: It is very likely that this app will no longer be needed once MS do their thing and integrate the products further.  I hope so to!


TechEd North America session wrap up


This morning at TechEd North America i did a session on Office and SharePoint 2013 App development.  In a nut shell it was 75mins of demos (8 or so).  It was a mix of things I have found handy developing Apps, things I think are going to play an important role in App development (SPA apps) and other things that I think are handy for those getting started with App development.

Here is a summary of the demos:

#1 SignalR:  Using SignalR in your apps backends for watching trace and debug information from your application. Great for when your code is running in Azure and you want visibility into what is going on.

#2 Token Caching: When you first are starting out with app development its not entirely obvious what all the tokens and parameters are that are passed to your app code. OR how to work with them.  This demo was all about showing a lightweight way to cache and store the tokens for use in subsequent pages.

#3 Use OAuth to access SharePoint from apps for Office:  This showed how to do “on the fly” OAuth from a task pane App in Excel.  This lets an application ask the user for permissions to SharePoint resources when needed. In the example i showed Excel, but you can do the same from a SharePoint app.

#4 / #5 The SharePoint cross-domain library: Two demos showing techniques for calling out to external services (in this case my blog) from JavaScript running in a SharePoint hosted app.  Also how to set up the CSOM for calling into the Host Web SharePoint site where you app is installed.  Both scenarios show cross domain techniques available.

#6 Bring Office documents into your SharePoint apps with the Office Web Applications:  Most people have seen the document preview windows you get in SharePoint search and document libraries that use the Office Web Applications. But you can also use these in your own Apps too.  Great way to show documents alongside your App content.

#7 SPA Apps:  Single Page Applications.  Very kindly Andrew Connell allowed me to show his recently built Learning Path Manager demo which showcases an App built using Durandal, Knockout, Bootstrap, FontAwesome, LinqJS and Toastr.  Finally SharePoint development has been possible using frameworks, tools and techniques that are moderns and current.  All the cool kids are doing this stuff and I think its going to be a very interesting option for SharePoint app development going forward. For source and more information please refer to AC’s blog post. 

#8 App CSS makes your app look like part of the experience: A simple demo showing how to use the Chrome Control and SP CSS in your provider hosted apps.  I skipped this in the session due to time.

#9 Elevate your SharePoint app’s permissions with app-only calls: No more running code in process as system!  The App model provides a fairly elegant way to elevate permissions without losing control of an apps privileges! Apps can make “app only” calls to SharePoint to do things that the App has rights to do, but not necessarily the user using the App.

#10 Yammer Integration – Bring your app to where users are by posting to the feed:  Yammer provides some nice APIs to work with.  For example REST APIs for posting the feed & OpenGraph APIs for posting activities.  I demoed an App called “ShareIt” that takes a document and posts it to Yammer. The app will hopefully be in the 365 marketplace shortly (free) and I hope to do a follow up “how it works” blog post on it + full source for the app.

Slides: (they are boring … just intros to the demos)

Demo files: The zip below contains the demo files for demos #1 – #6 and  #8 and #9.  SPA code comes from AC here and the ShareIt code (Yammer) will come out as part of my new blog on that App shortly.

The recording of the session will be up on Channel 9 in the next 24-48 hours i am told:

Happy App’ing!