<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Azure Functions on Thomy Gölles</title><link>https://thomygoelles.com/tags/azure-functions/</link><description>Recent content in Azure Functions on Thomy Gölles</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 17 Nov 2017 23:07:20 +0000</lastBuildDate><atom:link href="https://thomygoelles.com/tags/azure-functions/index.xml" rel="self" type="application/rss+xml"/><item><title>Theodore - a bot for creating a team in Microsoft Teams</title><link>https://thomygoelles.com/theodore-a-bot-for-creating-a-team-in-microsoft-teams/</link><pubDate>Fri, 17 Nov 2017 23:07:20 +0000</pubDate><guid>https://thomygoelles.com/theodore-a-bot-for-creating-a-team-in-microsoft-teams/</guid><description>&lt;p&gt;My last posts were all about getting up to speed with the Microsoft Teams PowerShell cmdlets released two weeks ago. Running those cmdlets in an Azure Function creates some nice options in terms of creating a team in Teams (still, the wording is just awkward). I&amp;rsquo;m sure you read about all the governance discussion that services like Teams or Groups start in each environment. Only with proper tooling, you can manage the process of orchestrating your different collaboration features in Office365. To take this idea to the next level, what about using a bot in Teams to handling a users request of creating a new team. &lt;img src="http://www.modernworkplacesolutions.rocks/wp-content/uploads/2017/11/Theodore-Architecture.png" alt=""&gt;This post describes how you can create a bot for your users that will ask for some data in order to create a new team in Microsoft Teams. The bot will call an http triggered Azure Function that is using PowerShell to handle the requests and has the new Teams cmdlets deployed to be able to create a new team in our tenant.    To code in the git hub repo is based on an example project (&lt;a href="https://github.com/Microsoft/BotBuilder-Samples" target="_blank" rel="noopener"&gt;https://github.com/Microsoft/BotBuilder-Samples&lt;/a&gt;)  of a dot.net bot that shows how the different dialogs in a bot can be wired together. The solution is quite simple and of course no way production ready: &lt;img src="http://www.modernworkplacesolutions.rocks/wp-content/uploads/2017/11/TheodoreSolution.png" alt=""&gt; An example dialog of the bot looks like this: &lt;img src="http://www.modernworkplacesolutions.rocks/wp-content/uploads/2017/11/TheodoreConversation.png" alt=""&gt; To create this kind of dialog you simply start the interaction with the user with code like this:&lt;code&gt;private async Task MessageReceivedAsync(IDialogContext context, IAwaitable&amp;lt;IMessageActivity&amp;gt; result) { PromptDialog.Choice( context, this.AfterChoiceSelected, new\[\] { ShowMyTeamsOption, CreateTeamOption }, &amp;quot;Hi I'm Theodor your Team automation but. How can I help?&amp;quot;, &amp;quot;I am sorry but I didn't understand that. I need you to select one of the options below&amp;quot;, attempts: 2); }&lt;/code&gt;This will create our two different buttons and will guide the user in the directions we want them to choose from. After we have all the data from the user, in our case just an alias and a display name, we can now call the Azure Function handling our request.```
Dictionary&amp;lt;string, string&amp;gt; dictionary = new Dictionary&amp;lt;string, string&amp;gt;
{
{ &amp;ldquo;displayName&amp;rdquo;, this.displayname },
{ &amp;ldquo;alias&amp;rdquo;, this.alias }
};&lt;/p&gt;</description></item></channel></rss>