It’s no secret that I think Microsoft Teams is an awesome product. I’ve written in the past about how I believe Teams is a great enabler for making people more productive and brings the right tools together in a place that makes a lot of sense.
What are messaging extensions?
Message extensions are available when you are creating a chat message (either a new conversation, or when replying to an existing message). Message extensions assist you by inserting content into the chat message you are composing.
Below is the Giphy messaging extension that allows you to search for an animated image and insert it into your message.
Why develop a messaging extension?
One of the resounding benefits of the Microsoft Teams client is being able to extend the out-of-the-box capabilities and integrate with your existing line of business (LOB) applications. Usually the benefit gain in integrating LOB applications into Teams is that it reduces the context switching for users and they spend more time actually getting work done, and less time moving between application, copying/pasting data or links.
Take a CRM application as an example, if you are discussing a customer in a conversation in Teams and needed to explain where that customer was located, or what the contact details were. The steps you would normally go through would be to open your CRM application, search for the customer, find the relevant details, then cut and paste multiple fields of text switching back and forth between the customer details in the CRM app and the conversation in Teams.
By extending Teams with Messaging Extensions, it is possible to provide an integration into your CRM system that would allow a user to search for a customer in Teams while composing a chat message, select the customer and have the details formatted nicely and inserted in the chat message all without having to leave Teams or even open the CRM application.
When you look at the core LOB applications within your organisation there are some key integrations such as this that can bring about real productivity gains.
Where to start with messaging extension development?
One of the critical components of an Office Add-in is the add-in manifest. This is the xml file that describes how your add-in should be activated when an end user installs and uses it with Office documents and applications. This manifest contains references to URLs where your web application resides and also to other resources for your add-in such as images to show on ribbon buttons and task panes.
Your manifest.xml file is uploaded to a central location where it is made available to users of your add-in (this may be a public location such as AppSource or the Office Store).
When users acquire your add-in a copy of the manifest.xml file is cached onto the host device and is only periodically resynced if the manifest.xml file is subsequently updated in AppSource/Office Store. I have seen this take weeks on some combinations of host products/devices.
You need to be careful if you are modifying your application and the changes involve modifications to the URLs in the manfiest.xml file. Imagine your add-in has been deployed and is in use by many users. The manifest.xml file might look similar to the fragment below (notice the SourceLocation URL on line 13).
That SourceLocation URL (line 13) is the main page of the add-in that gets loaded into the Task Pane when the add-in is launched. Lets imagine you change the structure of this add-in so that the starting page of the app is now https://www.contoso.com/apps/search/index.html
How do you go about deploying the updated manifest file that points to this new URL?
If you update the manifest.xml file with the new URL you then have to go through the AppSource/Office Store submission process to get the new manifest approved. You are far from 100% in control of the approval process so you don’t know when the new manifest will get approved and thus when the new URL will come into effect. So do you need to keep your application running at both the old and the new URL at least until the new manifest is approved? It gets a little worse than that though, it seems the deployment of a manifest change can take weeks to reach “saturation” whereby it had propagated down to all client host product caches and the old manifest is no longer being used. I can’t exactly tell you how long this process takes and if it ever fully reaches “saturation” as I’m still seeing some users hitting my service on a URL in a manifest that was superseded almost 3 months ago!
Rather than keeping your old and new application running side by side, the approach I have taken that works quite nicely is to put in place temporary redirects from any URLs that were present in the old manifest and have changed in the new manifest. I suggest creating these as temporary redirects as you will be able to monitor your traffic over time and know when you have reached saturation and you stop getting users coming in on URLs from old manifests. If you use permanent redirects, this may get cached by the client and next time the client will have done the redirect itself and you will no longer be able to track if the new manifest has been deployed or it’s an old manifest being redirected via a client side cached redirect.
How do you go about implementing temporary redirects? Well this depends on what you’ve developed your website using and how you are hosting it. In my case I am hosting the app as a Web App in Azure, redirects can be configured in the web.config file that is located in the root folder of the Web App.
Below is an example web.config file that would achieve that temporary redirection.
The Insider Dev Tour is such a great event for Microsoft developers, you get the key announcements and latest news that came out of the Build Conference, delivered locally in a more intimate and interactive environment. Best of all it’s a free event put on by Microsoft.
I was very grateful for the opportunity to present two sessions at the Insider Dev Tour in Sydney last week.
- Create Productive Apps with Office 365
- Drive User Engagement Across all your Devices with Microsoft Graph
If you attended I hope you enjoyed the experience as much as I did. The following are links to the resources mentioned during the presentations.
I had the pleasure this week of speaking at the Sydney SharePoint User Group on the topic of transitioning to the modern Office Add-in development model.
- The existing COM/VSTO Office Add-in development model
- The reasons and drivers for needing a new development model
- What the modern Office Add-in development is and how it works
- Benefits of the modern model
- What this transition means for Office developers
- A look at the typical modern add-in technology stack and discussing some of the options
- The wider Office Developer Vision (Extending Office through add-ins + accessing Office 365 data via Graph)
Thanks to those who attended and as promised here’s a link to the slide deck from the nights presentation.