Azure Functions and Microsoft Teams

Andreas Helland
Contosio Labs
Published in
3 min readNov 15, 2016

--

A little over a week ago Microsoft launched “Teams”:

Some have called it an attempt at delivering a “Slack-killer”. I would say I see some hints of Yammer-deprecation there as well though. While Slack is part of my daily workflow I can’t really say I have used Teams enough yet to make a call on this. (I use Yammer early in the morning, late in the evening, and in-between, and there are things there I would like to work in a more Teams-like manner though.) Since it’s currently restricted to being used within an org, and requires an Office 365 subscription, I don’t think slackers will be switching en masse yet regardless of features mind you.

Anywhoo. I don’t want to list pros and cons for either solution yet; I just want to scratch the surface of what integration one can do with Teams.

Let’s go with what has become a classic staple by now — webhooks and Bender :)

Once you have a team, and at least one channel setup you can add incoming webhooks to it:

Creating incoming webhook

If you just want to test it quickly you can line up Fiddler/Postman/something and do a POST towards the URL with a json payload of {\”text\”: \”Hello World!\”}.

Unsurprisingly I prefer to do it with Azure Functions instead:

BenderToTeams.csx

Execute it, and things will look similar to this in your channel:

Message from Bender

I fancied up the code slightly by adding support for more of the available properties, but there is more than I put in here for further tweaking the message. Want to do “everything”?
Reference docs here: https://dev.outlook.com/Connectors/Reference

And now you’re thinking — what about the other direction? I want outbound from Teams. Well, it doesn’t seem a generic outbound webhook is available yet. (“The Connectors Developer Dashboard is only available for building Connectors for Outlook. Support for Microsoft Teams is coming soon.”)

Our friend Bender could possibly be implemented through the Bot support. I haven’t tested that yet as I would like to test out the Azure Bot Service, (also based on Azure Functions), that went into a public preview earlier today before deciding on that part:

It’s a start though, and I’ll certainly need to keep track of where Teams is going in the coming months.

--

--