Azure

Blog posts about Azure

Hack4Good – My First Hackathon

Hack4Good Group Photo

TL;DR

I’ll warn you – this is a long read! To summarise though – this Community is beyond awesome and the Hack4Good event just proved that we can genuinely change the world.

The Hype

When TDG announced that there was to be a hackathon in London, with the focus of it being the Non-Profit/Charity sector, I was straight in there on the registration (after which Mrs H was then informed  that I was booked in – easier to ask forgiveness than seek permission)

This was to be my first ever hackathon, a year ago I hadn’t even HEARD of hackathons, and it ticked so many boxes for me. For those who don’t know, it’s not hacking in the sense of breaking into systems etc – this is all about using software and platforms that are at your disposal to hack together a solution to a scenario within a given time limit. The most innovative, practical, deliverable, and potential-filled solution would win the day.

When the emails started to come out Chris asked (in typical CAPS LOCK STYLE) if I would lead a team. Me being me, I jumped at the chance – in for a penny, in for a pound.

And so the excitement began. Weeks turned into days, and my poor family and friends got fed up of hearing how stoked I was. When I saw this list of other team leaders, and saw the people who were on my team, I started to question my credentials. There were so many legends of the community involved – people I look up to, and follow with eagerness and anticipation.

The Buildup

At 5:30am on Saturday 16th February, loaded with snacks and tech, I headed towards the railway station. Nerves meeting with excitement, doubts meeting determination.

Arriving just before 8am I was struck by just how, on first impressions, the Microsoft Reactor in London is a strange space. Fully stocked drinks area, with stereotypical caffeine overload available, games area, and then a large open space with tables and a large video screen. It almost seemed spartan in its simplicity.

As everyone started to arrive, and we set up our various laptops and devices, that open space suddenly became this hive of technology and potential.

Hugs and Hellos were dished out with abandon, and cries of “It’s so good to meet you at last” were deafening in their abundance. I moved from person to person and finally got to meet people who I’d talked to online or who I’d been following for ages. I was even surprised to find people who wanted to meet me!

The Morning

With typical fervour and energy the trio of Chris Huntingford, Kyle Hill and William Dorrington (who had come over for the start despite having removal lorries outside his front door!) kicked off the day.

A surprise video message from James Phillips, Corporate Vice-President of Microsoft, impressed upon all of us just how much the community is noticed by Microsoft and raised the expectations of all in the room another notch. If our dials were at 11 before that video, they were at 12 afterwards – and even Spinal Tap didn’t get to 12!

I’ll be honest at this point and admit that I can’t remember who presented exactly what and when – my mind was a maelstrom of ideas and planning.

The engaging Architect and Storyteller Alex Rijnoveanu (@WomanVsTech) from Microsoft delivered enthusiasm and encouragement.

The very funny, and trying-not-to-be-as-sweary, Sarah Critchley (@crmcat)presented in a way that only she could – with an idea about helping out stray cats using powerapps and other bits.

m-hance presented alongside Solent Mind, and that I related to what they did in a huge way because of the work I see in my day job at St. Andrew’s Healthcare. It was a sobering presentation in many ways, but also opened up our eyes as to “the art of the possible”.

Saurabh Pant and Sameer Bhangar had flown in from Microsoft (yes, all the way from Seattle) just for this event and then through away their planned roadmap presentation to give us all a major pep talk and stir us up even more. I have to say that the funniest thing was their very friendly (and also slightly sweary) rant about how much they had heard about Samit Saini in the past year! In so doing, it just served to show us all just what was possible – those who knew Samits journey smiled and laughed, and those who didn’t had their eyes opened to a new level of potential.

Quantiq presented some of the work they had done with the Leonard Cheshire charity and also give a glimpse of their toolkit for healthcare and the ideas kept flowing. As I look around at the other teams I could see people taking notes, typing away, and whispering to each other. This hackathon was going to be competitive, but boy was it going to deliver some amazing results.

I’ll apologise now to all the presenters as I haven’t done you justice in my few words, and I may have mangled your presentations up, but believe me when I say that all the presentations hit home with all of us listening. Those presentations took our plans, determination, and enthusiasm up to levels you just wouldn’t believe if you weren’t there!

Let The Hacking Commence

With a final presentation to lay down the rules of engagement, and also to make it clear that stopping for lunch was most definitely not an option, the starters gun was fired and the 4.5 hours of planning, building, and preparing began.

The buzz in the room was electric as each team discussed and planned out their scenario and then grabbing whiteboards and white space to map out what a solution could look like.

I’ll be writing more about the Team White proposal in the coming days, as there is more to come from that, but we settled on a solution that would utilise so much of the stack but would be able to be modularised and deployed as a “solution-in-a-box” approach.

With my amazing team of Penny, Josh, Denis and Raj we set about building Microsoft Forms, PowerApps, Dynamics 365 solutions, Flows, and the concept of the Hololens. Oh yes, Gadget King Raj had brought us a Hololens – and that just expanded the possibilities for us. We weren’t looking at gimmicks and tech-for-techs-sake, we were looking at a genuinely life-changing solution using some amazing software and hardware.

With a soundtrack of some amazing 80’s rock being pumped out (and yes, thanks Chris for Rickrolling us!), everyone was doing something. If you could have harnessed the energy in that room at that point you would have been able to power half of London.

Floor walkers popped by each of the teams each one listening and absorbing before offering advice, help, suggestions and more – but what was even more amazing was that the teams were all talking to each other. You read that right, the teams all talked to each other.

There was sharing of scenarios, encouragement, suggestions for improvement or additions, and helping hands. This was a competition that was like no other. This was a competition in which we ALL wanted to see every team achieve their goals. I’m a mildly (ok, seriously) competitive person at times and yet there was no sense of barging past each other to reach the finish line. This was collaboration and cooperation in competition towards a common goal.

The Winners

And with 4 and a half hours gone in the blink of an eye, the race was run. It was time to do the 5(ish) minute speed-dating presentation of the solutions.

As each team stepped up and shared I really do not know how I held it together. These were genuine scenarios, delivered with innovative solutions, and by passionate people.

Every last one.

We all watched, applauded and cheered. None of us could separate the competition. Judging was going to be tough, and so it proved.

With our hosts waffling as much as possible whilst the judges adjudicated, we all sat wondering just who it would be. We all wanted to win, but we all knew that whoever did win was fully deserving of it.

With the decision made, the announcement came that Team Grey (who had flown over from Germany to take part!) had won with an app for rounding up as you ordered food or transport and donated this to your charity of choice. Writing that makes it sound simplistic, but if you think of the implications of it you soon realise that it has massive potential.

It Is NOT Over!

The final speeches and thank you’s were made, the applause leaving hands feeling rather raw and sore, but this isn’t the end. Every proposition in the room has legs, and every person in the room knew that this couldn’t stop just because the clock had run down.

Saturday saw the start of something, the spark that starts a fire. We all felt it and reading all the posts on twitter and LinkedIn etc after the event just reaffirms that determination.

We saw not a glimpse, but rather a bright shining beacon of the power of the community. I go on and on (and on) about Community but what happened in that room on Saturday, with just a part of the enthusiastic and passionate community present, just proved what we can all achieve if we put our minds to it.

Here TDG we have the Community Collaboration Portal for working on community projects together, and there’s the Power Platform Bank for making solutions available, and then there’s all the social media channels out there as well.

Let’s turn this spark into a raging fire of change. Let’s use our collective skills to build new solutions to old problems.

Oh, and let’s do this again real soon!

 

 

 

All the voices

“A woman with a voice is by definition a strong woman. But the search to find that voice can be remarkably difficult.”  – Melinda Gates

 

Companies love dashboards. The idea of progress, of something to announce, is like a drug. Naturally, companies use data and dashboards to measure diversity.  With one click, we can see how many people of what origin, education and sexual identity are employed anywhere within that company.  What those dashboards can’t tell you, no matter what your amazing PowerBI skillz (sic) may be, is the actual effectiveness and impact of that diversity down to the team or individual level.   Data and dashboards struggle with the intangible, with context. (I say this with all due respect to data scientists and my “blue” colleagues.)  Dashboards struggle to tell you if all those amazing voices that the company has invested so much in recruiting are actually being heard. This is the nuance of inclusion.

This is where checking the box on the dashboard stops and the application of the sought-after differing points of views begins.  And honestly, this is where so many teams fail.   The representation is in the room, but the team culture hasn’t evolved, the manager is still talking at people, the environment isn’t functioning.  The loudest voice still stands out.  Suggestions are quickly brushed aside until repeated by another more well-known contributor.  Questions are directed at the wrong person.  And then people just shut down, go back to their old ways, and that highly sought-after talent leaves.  Oh well, she wasn’t a good fit anyway. 

The pressure on groups to produce results quickly isn’t going away.  This intangible nuance of hearing all voices is easily pushed aside in the name of speed since it can be very difficult to measure. Worse yet, incorporating all the voices can actually slow things down at first, while in the end making the output so much better. How to show that the end justifies the means?

I propose that the best way to measure something is to start with a remarkable subset.

Enter the #msdyn365 community at 365 Saturday.  For me, it started in Dublin.  Actually, it started way before then, it just became more deliberate in Dublin thanks to the event organizers (looking at you, Janet and Raz) then took further shape in London and most recently solidified in Glasgow.  At these all day events (on a Saturday, just like the name implies), informal groups of women at various stages of career gathered for an hour under the umbrella of Women in Technology (#wit), not quite sure what to expect.

Each session has been different, because as with many things, the conversation is a result of the sum of the amazing diverse parts.  Topics varied, yet it all came down to one overarching theme: communication.  Whether that be the how, the when or the why of when to use our voices.  We talked about #confidencehacks, about how to establish ourselves without crossing a line that makes us uncomfortable (and practicing not caring about making others uncomfortable), about connecting and expanding our networks, and then most importantly we talk about amplification – how we can help others’ voices be heard.  All voices, not just female.

Note: There are so many other cultural considerations here, for which I lack a point of reference.  There is also a whole discussion to be had about how people consume, digest and respond to information.  For example, the work culture that I grew up in was as follows: get in a room, review a PowerPoint, have a passionate discussion where the loudest voice usually wins, determine next steps, assign actions items, repeat.  That format doesn’t work for all.  What about the voice of the incredible introvert in the room that needs time to digest the info, consider all sides, and then voice their opinion?

And there is the other amazing thing about our #msdyn365 community.  Others want to know how they can help.  Sure, I was teased about “super-secret lunches” by male colleagues.  I saw that for exactly what it was – curiosity and a sincere wish for dialogue.  Why is it necessary to have a “womens’ anything”? Shouldn’t it just be about hiring the best person for the job?  How should we feel about this?  We all treat each other with respect, right? Isn’t it up to individuals to make themselves heard?

Truth is, I agree with everything above.  Inclusion, by its intent, is about everyone.  And therefore, everyone has a responsibility to feed this culture and in the end everyone will benefit. We all can and should help amplify the voices of others. What I love about getting small groups of women together is that the coaching and dialogue that happens in a really safe environment then goes out into the diverse world and multiplies. It starts with a subset. Never underestimate the ripple effect of small actions.

Fifty percent (50%) of the speakers at 365Saturday Scotland identified as female.  Fifty percent.  That is crazy insane goodness.  It did not just happen.  This was the result of a community (led by Marc, Janet, Claire , Iain and so many others) rallying to make sure that opportunities were presented and seized, that a safe place was created and maintained, and that voices were heard.  Shouldn’t that just happen naturally?  Yes, ideally someday the flywheel will be spinning with such momentum that this will be the case (oh, and 50% of the attendees will also be women… work to do there as well).  Then the focus will become how to maintain and feed that system.  The moment you take your eye of something, you risk losing the muscle memory. Omission by unintentional oversight does not remove responsibility.

There is a meme about equity vs equality running around our social media feeds.  The one that show people of different heights trying to watch a baseball game over a fence.  The size of the boxes they are standing on depicts the difference between being treated equally (same sized box) and equitably (different sized boxes raising all to the same level).  The lesser known version has a twist – it shows what it would look like if there was no fence at all.

This is the nuance of inclusion.  This is how the #msdyn365 community is working to remove the fence.  It starts with these conversations, these opportunities. Listening to all the voices takes time and deliberate effort.  This community is all in.

Raise your voices. 🙂

Carissa

 

DYNAMICS CE WORKFLOWS SCHEDULING USING AZURE FUNCTION APP WITH TIMERS

A ‘making-dynamics guy’s life-easy‘ solution to schedule your Dynamics CE out of box workflows to run on particular frequencies is finally here!

System workflows are the best when it comes to doing a simple task without having to put our heads into writing hell a lot of coding. However, the real pain comes into scene when you want to schedule them as per your requirements. Well, if you’re wondering how you could make this work out in a simple way, here’s the good news – this is totally achievable using the winning combo of an Azure function app with a timer associated with it. If you want to read more about the how Azure function works, you can use this link – https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview

Now, if you want to dive right in, you’re in the right place.

 

ADVANTAGES:

 

  1. Unlike other solutions, the usage of Azure functions allow you to enjoy the benefits of a server-less setup. These are perfectly designed to run without a server and to integrate and monitor jobs that run within CE.
  2. Connection to CE can be made by referring to the core SDK libraries using NuGet.
  3. It consumes less number of resources for running, without having to use custom entities in CE to configure the scheduler.
  4. Easy management of the functions that are set up. You can enable or disable them as and when required just by a button click.
  5. Detailed logging of successes and failures of the workflows that are being executed on frequencies
  6. Handles bulk jobs with a function timeout of 10 minutes. (how cool is that!)

 

PRE-REQUISITIES:

 

This list is surprisingly not long. All you need for this to be set up successfully is, an Azure Subscription or a free Azure trial login account to give it a go.

 

STEPS:

 

  1. Login to your Azure Account, from https://portal.azure.com. You will be able to see your Dashboard in the home screen.
  2. Click on ‘Create a resource’ option, located on the upper left-hand corner of the page.
  3. Type in ‘Function App’ in the search box that appears, enter all the required values and click on create. Once the function starts deploying, wait for the Deployment Succeeded message to appear in your notifications.

  1. Open the app that you just created and create a new function for the app. Make sure you select the type as ‘Timer Trigger’ while you create , as shown below

  1. Set a schedule timer using CRON expression which is displayed under the Integrate section of the function. The format of this expression will be {second} {minute} {hour} {day} {month} {day-of-week}.

I have set the timer expression as 0 */5 * * * *, which means that the workflow will run for every 5 minutes. To know more about different timer settings, refer this link – https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer.

 

  1. Connect to Dynamics CE by referring to the core SDK assemblies using NuGet. Go to Platform features tab on the function and click on App Service Editor. This will open up all the files in the folder in a new window. Create a new file called ‘project.json’ within the same function folder. Use the following code snippet to connect to the CE SDK assemblies.

{

“frameworks”: {

“net46”:{

“dependencies”: {

“Microsoft.CrmSdk.CoreAssemblies”: “8.2.0.2”

}

}

}

}

 

 

  1. We will then add configuration parameters in Application settings of the function, for the C# code to run. These parameters include the CRM instance URL that you are connecting to, the appropriate credentials for connection and the actual name of the workflow that needs to run on the scheduled time.

  1. Now, we add in the following piece of code that triggers the workflow specified in the configuration parameters using the credentials mentioned in the above step.

using System.Net;

using System.Configuration;

using Microsoft.Xrm.Sdk;

using Microsoft.Xrm.Sdk.Client;

using Microsoft.Crm.Sdk.Messages;

using Microsoft.Xrm.Sdk.Query;

 

 

public static void Run(TimerInfo myTimer, TraceWriter log)

{

IServiceManagement<IOrganizationService> orgServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(ConfigurationManager.AppSettings[“CRMinstance”]));

 

//Connect to the CRM instance

AuthenticationCredentials authCredentials = new AuthenticationCredentials();

authCredentials.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings[“CRMusername”];

authCredentials.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings[“CRMpassword”];

AuthenticationCredentials tokenCredentials = orgServiceManagement.Authenticate(authCredentials);

 

//Retreive the service

IOrganizationService service = new OrganizationServiceProxy(orgServiceManagement, tokenCredentials.SecurityTokenResponse);

 

//Get the workflow GUID to run from workflow name

QueryExpression objQueryExpression = new QueryExpression(“workflow”);

objQueryExpression.ColumnSet = new ColumnSet(true);

objQueryExpression.Criteria.AddCondition(new ConditionExpression(“name”, ConditionOperator.Equal, ConfigurationManager.AppSettings[“CRMworkflow”]));

objQueryExpression.Criteria.AddCondition(new ConditionExpression(“parentworkflowid”, ConditionOperator.Null));

EntityCollection entColWorkflows = service.RetrieveMultiple(objQueryExpression);

if (entColWorkflows != null && entColWorkflows.Entities.Count > 0)

{

 

Guid workflowGuid = entColWorkflows.Entities[0].Id;

if(workflowGuid != null)

{

//Get the fetchxml string from Configuration

string entitySetting = ConfigurationManager.AppSettings[“CRMFetchString”];

FetchExpression fetchRecords = new FetchExpression(entitySetting);

 

EntityCollection recordsCollection = service.RetrieveMultiple(fetchRecords);

if (recordsCollection.Entities.Count > 0)

{

log.Info($”Records fetched : {recordsCollection.Entities.Count} at {DateTime.Now}”);

foreach (Entity e in recordsCollection.Entities)

{

ExecuteWorkflowRequest request = new ExecuteWorkflowRequest()

{

WorkflowId = workflowGuid,

EntityId = e.Id

};

log.Info($”Executed workflow successfully : {DateTime.Now}”);

 

// Execute the workflow.

service.Execute(request);

}

}

}

}

 

log.Info($”C# Timer trigger function executed at: {DateTime.Now}”);

}

 

  1. You can test run the C# code you added in the above step to make sure there are no errors.

 

  1. The function is by default enabled, and it can be disabled anytime you want by clicking on the enabled/disabled toggle button under the Manage option of the function. (I have disabled my function and that’s the reason why it has prefixed (disabled) to my function name).

 

  1. The ‘Monitor’ option of the function allows you to check for successes and failures of the function including the detailed logs included in the code.

 

 

And, that is all! Your azure function will keep running the specified workflow until you disable it.