Having a tight schedule? Fear not!

Hei bloggen!

In our last post, we presented our provisioning engine. Sadly, you don’t always have your loyal servant Podric Payne at hand, or a computer for that matter. Luckely, house Coudborne has a solution for those who cannot wait to wage more war!

The PowerApp is pretty simple: it adds new items to a list. This action triggers a flow, which sends a http – request to the flow discussed in our previous blog post, which again provisions a group.


The old flow is updated to check for an email address in the payload, and sends an email to said adress with the relevant information.




House Cloudborne (first, second and third of the Andals).

Battleplan generator on steroids

Hei Bloggen 👋

Planning a war and putting the plan into action can be tedious work, and with the frequency it is happening in Westeros, a horrible amount of time is wasted on setting up new plans for war.
Adding to this, the old systems are not easy to grasp and are quite ugly looking.

Analog maps – ugh

Following up Podrick Payne: Digital Squire, we felt he should be able to help the various lords and ladies of Westeros with smoothing this process (for a reasonable coin 💰, obviously).

So, more specific, what could we do to help? Well, the new Groups functionality from Office 365 seems to be a good fit. Common email adress? Check!✅ Shared OneNote? Check!✅ Common interface with easy-to-grasp battle information? Probably! 🤔
If only we could provision an O365 Group Site with the relevant information!

Sadly, there is no out-of-the-box way to provision groups in a manner that allows us to apply all the cool group features that we want. So we needed to implement some self defined azure functions, that a flow could be able to trigger. The functions in particular that we need are:

  • Create Group
  • Get group team site url
  • Apply-PnPProvisioningTemplate

With these three functions, and some logic behind and in front, we should be able to let Podrick “The Digital Legend” Payne generate the groups the way we need.

So what do Podrick have to do to create a room using the flow? He just have to send the correct information signature with the nearest raven 🦆 (or http client, we don’t discriminate) to the correct address.

This will trigger the flow:

And voilà, your new superhot battleplan is born! 👼

Next up,
how do you know your enemy is not listening?




Westeros Battle Simulator (WBS)

Hei Bloggen 👋

We are pleased to announce the brand spanking new ⚔️ Westeros Battle Simulator (WBS)  – which enables you to easily command your armies against your opponents.
This system is one of the key components of the Westeros Battle Command System.

In the WBS you have an SPFx web part that renders your current army size and battle stats (graph extension data). If you have available XP you can spend it on leveling up your foot soldiers and dragons.

The WBS makes it easy to level up you army by selecting the units that you would like to level up and then click on the level up list command (also an SPFx extension).

The WBS has a system for battle commands.

Currently it supports “Go to war”. The command sends your army to wage war against your selected opponent – if you win you gain experience points that can be used to level up your army. The gold you loot is used for conscripting new soldiers and dragons.

The business logic that calculates victory/defeat is currently in development – we use the Microsoft Graph to update Group extensions for Experience Points and Gold that are gained after a battle is won.

More on the business logic will come in our upcoming posts.



Podrick Payne: Digital Squire

Hei Bloggen!

We like bots – in fact we ❤️ bots 🤖 , and we’ve previously done node.js-bots on Heroku in Slack, with BotKit and facebook’s wit.ai.

Bender knows a four-letter word when he sees one

That was fun.

The MS Bot framework on the other hand has gotten pretty good in the last year, so we’re going all in using Azure as our main host for ACDC2018. Provisioning bots in azure is a breeze, and thankfully the bot web app module supports both C# and node.js.

To the point, my Liege!

All lords, lieges and army leaders need a way to place orders, have their questions answered, and a way to leisurely pass the time.
To solve this, we’ve supplied the Westeros Battle Command System with your own Digital Squire.

Podrick Payne – Digital Squire is here to answer your questions – just chat him up! 📝

“Who is the Merling Queen anyway?” – query An API of Ice and Fire
“It’s time to go to war!” – initiate War Room Protocol (more on this later)
“Let’s play Craps” – throw two dice, d’oh
“Do you..ehm, have any photos of the…uh…Mother of Dragons? For intelligence gathering purposes!” – image search

Podrick Payne, the Digital Squire is always at your fingertips, awaiting your Lord’s command.

Some facts about Podrick:

  • MS Bot framework node.js bot, utilising LUIS for natural language processing – to better be able to decipher my Lord’s drunken banter
  • Using the Direct Line API and Swagger (2, not 3, whatever), for embedding chat-functionality in authorized applications, without having to do the ADAL song and dance
  • Embedded as an SPFx React web part – using Office UI fabric (Change the look, baby!)
  • Backed by a plethora of azure functions
  • Utilizing CosmosDB DocumentDB data storage for Westeros-, Essos- and Sothroys-wide replication
  • Continuously integrated from our GitHub-repo (Did we mention we ❤️ CI/CD?)


Using Office 365 Public CDN in SharePoint Online

In the void – bytes counts. You think that’s air you’re breathing? The Appsters wanted to improve their solution by using the public CDN functionality in SharePoint Online. It’s pretty easy to enable in a tenant. I recommend this  Office Dev Center guide for how to do it, and I’m not going into details of exactly that here.

What it does is that enables a library/folder of your choice to be reached from Office 365 using a specific path on the format

https://publiccdn.sharepointonline.com/<tenant host name>/<ID of the public CDN origin>/<sub-path under the origin>

The Appsters’ public CDN URL is


We wanted to share how we work with the Public CDN and Office PnP templates. We are incorporating this into our solution using the CDN URL as a parameter into our pnp-templates.

We are then able to use the parameter when specifying the URL to our JavaScript and CSS files (Of course we’re not referencing every single file – we use a JavaScript script-loader that uses the Sod-functionality to load dependencies (but that’s for another blog post :)). As an example, take a look at how we reference the script-loader from a custom action:

And for the site logo:

And with Chrome Source explorer you can see that our files are loaded from the CDN.

We’re using the public CDN for all of our JavaScript-files, CSS-files, images and logos etc. The only limitation we’ve hit so far is that Office PnP parameters doesn’t work in .spfont files, unfortunately needing us to have the CDN-URL multiple places.

That’s it – happy coding!

How to trigger an Azure web job using the web hook from a flow

I spent some time to figure this out, so thought I would share.

We have a web job in Azure that runs a PowerShell-script that polls a list looking for new items, picks them up, creates a site collection and applies pnp templates. This works really well as a scheduled job, but it would be nicer if we could trigger the job automatically so we don’t have to wait for the scheduled start time.

It turns out that you can do this with the new Flow! Steps as follows:

  1. First you need the authentication tokens. Go to your App Service where you have the web job running, and click on Get publish profile 
  2. In that file, look for the publishprofile with publishMethod=”MSDeploy”. You need the userName and userPwd. E.g. in my case it was userName=”$ASPC2017″ userPWD=”LBxk5ttrvZTgAM7msxDGRZA0hy9Wws3gdNeuK33hacB52SSaAQRslmuzshzi”
  3. Then you need the web hook url. You find that by selecting your web job and clicking on properties.
  4. Go to the list from where you want to trigger the web job and create a new flow.
  5. The first step is to add a SharePoint action for “when an item is created”, and give the url to your site and your list as input.
  6. The next step is to add an HTTP-action. Choose method POST, add the Uri to the web hook url. You don’t need to set headers and body. Choose Basic authentication and use the username and password from step 2.
  7. The final flow should look like the following

That’s it! After an item is added to the list, your web job will trigger and start running. Happy coding!

How to consent to an Office 365 service app

Many times you might want to create services which interact with the Microsoft Graph. If your application has an actual web page you will get prompted when you visit and login to do the actual consent. If you have elevated privileges you would tack on &prompt=admin_consent to the URL and then your service can authenticate and do what you need it to.

If you just create an Office 365 entry and have no web application tied to it, this is not automatic.

One approach to get the consent URL is to create a small c# app using ADAL.

string ResourceId = "https://graph.microsoft.com"; // Microsoft Graph End-point
Uri RedirectUri = new Uri("[APP ID URI]");
ClientId = "[O365 App ClientId]";
ClientSecret = "[O365 App ClientSecret]";

var authenticationContext = new AuthenticationContext("https://login.windows.net/common/");
var url = await authenticationContext.GetAuthorizationRequestUrlAsync(ResourceId, ClientId, RedirectUri, UserIdentifier.AnyUser, "prompt=admin_consent");

If you have a multi-tenant app, the above code has to be ran per tenant where the service will act against.

Pro tip for triggering Microsoft Flow’s from code

As the trigger action pick an HTTP Request action.



Then head over to http://jsonschema.net/#/ to generate the swagger JSON schema needed. Just enter your JSON object, any way you want, click generate schema, and copy paste the output into the Flow action.


Your object properties are now available to use in a new action, as the one picture below where we create a new CRM record.



Once you save your Flow, you can copy the endpoint URL and do a POST with your JSON object to that andpoint and you’re ready to roll Smile