Connected Field Service with Azure IoT Hub – The Setup

In today’s post, we are going to set up “Connected Field Service” with Azure IoT Hub. A quick recap from the last two posts: 

  1. We started this series by having a look at the raison d’etre of using IoT with Dynamics 365 Field Service
  2. Next, we took a satellite view of various approaches with respective technology stacks 
  3. In this third post, we are going to get a little more hands-on as we will start working on the first approach with Azure IoT Hub.

Pre-Requisites

  1. Dynamics 365 CE tenant with Field Service 
  2. Azure subscription

Above could be trial instances and may not necessarily need to be on the same tenant. In other words, this setup will work even if you have Azure and Dynamics 365 on two different tenants. 

Side note: this second point is really cool because it takes away the dependency of setting up the two services on the same tenant. For instance, you could use your standard Dynamics 365 instance with a free-tier Azure subscription to explore this feature. 

The Setup: 

In Dynamics 365, open ‘Connected Field Service’ app and click on Settings. Click on the ‘Link to Deployment App’. It may ask for permissions for an app to access Azure and Dataverse, click  ‘Accept’. 

This ‘Deployment App’ is an excellent wizard-based tool as it hides underlying technical complexities and simply asks few questions to provision and set up Azure resources and make them ready to talk to Dynamics 365 environment. In the first screen, we need to select Dynamics 365 environment, agree to T&Cs and click Next. 

Next, we need to connect to Azure subscription. If it is on the same tenant, it will go and bring up your subscriptions otherwise you can sign in with a different login. Select the correct Azure subscriptions and click Next

In this step, leave everything as it is and click Next. Basically, we are going with default options and since we are setting up these resources in Azure for the first time, we don’t need to ‘use existing resources’. Click Next. 

Magic is happening

…may take couple of minutes or more

Oh one last thing, as all the azure resources are deployed – next we need to authorise Azure to talk to Dynamics 365. Click on the button: 

It will open up ‘API Connection’ in your Azure portal. Click on ‘Edit API connection’

Click on Authorise 

That will basically enable Azure to talk to Dynamics 365 using that authorised connection 

..and that’s it. But before we finish today’s adventure let’s quickly see what did ‘Deployment App’ do behind the scenes. While you are in Azure, click on All Resources (from the Home screen). This will show you all the resources that are added.

As you can see, it’s a combination of various Azure products but first and foremost, we have Azure IoT Hub. This is going to be the engine of IoT related capabilities. We then have some Logic Apps to run both way comms between Azure and Dynamics 365. API connections are there to support this data traffic and then we have other resources for storage, analytics etc.

I hope this sound very exciting. In the next post, we will have a look at IoT Hub and see how does comms work between IoT devices and Dynamics 365 (via Azure). 


Thanks for reading!

Dynamics 365 Field Service and IoT – Technology Stack and Approaches

In the previous article, we looked at the fundamental premise of connecting IoT devices with Dynamics 365 Field Service. Today let’s have a look at various technology options for enabling this conversation between IoT devices and Dynamics 365. There are essentially three different approaches while working with Azure and Dynamics 365 Field Service:

  1. Azure IoT Central with Dynamics 365 Field Service
  2. Azure IoT Hub with Connected Field Service
  3. Third-party with Dynamics 365 Field Service

Let’s delve into details of each of these approaches for further details:

1. Azure IoT Central with Dynamics 365 Field Service

First thing first, a quick introduction to Azure IoT Central:

Azure IoT Central is cloud-based web application (SaaS) that is capable of (a) connecting with a variety of IoT devices, (b) centrally manage, and (c) provides a mechanism to integrate with business apps

Azure IoT Central also comes with a variety of industry accelerators (open source as well) which further helps in getting an IoT portal up and running pretty quickly. As IoT Central receives signals and alerts from devices, you could define rules (above or below a certain range, for example) and based on those rules, alerts could be sent to Dynamics 365 Field Service using Power Automate flows.

Pros ✅ and Cons ❎:

  • Simple architecture ✅
  • Short time to market ✅
  • Doesn’t require specialised skills ✅
  • Customisations are not possible ❎
  • Device-level services are not exposed ❎

2. Azure IoT Hub with Connected Field Service

Introducing Azure IoT Hub and Connected Field Service first:

Azure IoT Hub is a full-fledged cloud-based PaaS that connects to both IoT and Edge devices, ensure secure communication channel between cloud and devices, is able to support bi-directional communication with millions of devices and fully integrates with other Azure products like Event Grid, IoT Edge, Stack Hub, Machine Learning etc.

Connected Field Service is a solution that (a) Dynamics 365 model-driven app, (b) Dataverse information structure for IoT devices, alerts etc., and (c) a capability to integrate with Azure IoT Central and Azure IoT Hub.

Connected Field Service provides a mechanism to setup Azure IoT Hub and related products (e.g. Azure Logic Apps to communicate with Dynamics 365, Azure App Services etc.) seamlessly using a wizard. This solution stack serves as a powerful platform for integrating and listening to millions of devices securely, communicate two-way, ensure device-level authentication, and tight coupling with business rules in Dynamics 365.

Pros ✅ and Cons ❎:

  • Powerful customisation options ✅
  • Device-level controls ✅
  • Supports a variety of protocols and SDK for major languages ✅
  • Cost can be fine-tuned based on consumption ❎
  • Requires specialised skills to setup and monitor ❎

3. Third Party with Dynamics 365 Field Service

Thanks to Azure and Power Automate, any third party IoT SaaS or PaaS solution can send IoT alerts or receive commands from Dynamics 365 Field Service and Connected Field Service. The benefits of integrating a third-party IoT system with business applications are many: from end-to-end business coverage to bringing the element of proactivity (versus reactivity) in services portfolio. There are numerous examples of Dynamics 365 Field Service ingesting devices data through Azure or sending commands based on business rules.

This concludes the overview of various technology approaches that are available for IoT devices to talk to Dynamics 365 Field Service. The next article in this series will be hands-on walkthrough of the first approach.


Thanks for reading!

Scottish Summit and Connected Field Service

As my binge watching of Scottish Summit 2021 continues, today I came across awesome session of Kyle Mclendon on ‘Alternative Design patterns for Connected Field Service‘. The session was full of valuable original content on IoT, CFS and architectures from POC (proof of concept) to real-life implementations.

This was the first speaking session of Kyle in any conference, which makes it all the more impressive. Kyle started the session with definitions of assets, devices and the basics of IoT architecture and then delved into various IoT systems’ design choices, the ‘hows’ and ‘whats’ of it. I would call it a must-watch for IoT and Dynamics 365 Field Service practitioners:

Thanks Kyle McLendon for the great session!

References:

  1. Reference IoT Hub / Connected Field Service architecture: Connected Field Service with IoTHub Architecture | Microsoft Docs
  2. Data flow between devices and IoT architecture components: here