Azure en IOT 1
Azure en IOT 1
Overview
IoT architecture concepts
Compare Azure IoT options
Preconfigured solutions overview
Get started
Remote monitoring
Deploy the preconfigured solution
Operate the preconfigured solution
Remote monitoring (previous version)
What are the preconfigured solutions?
FAQ
Get Started
How-to guides
Predictive maintenance
Predictive maintenance solution overview
Predictive maintenance solution walkthrough
Connected factory
Connected factory solution overview
Connected factory solution walkthrough
Device simulation
Deploy device simulation
Explore device simulation
How-to guides
Remote monitoring
Perform advanced monitoring
Use rules to detect issues
Manage your devices
Troubleshoot device issues
Use simulated devices
Customize the solution
Deploy using the CLI
Connect a physical device
Concepts
Connected factory
Deploy a gateway for connected factory
Customize connected factory
Use the OPC publisher for connected factory
Configure connected factory
Permissions on azureiotsuite.com
Reference
Developer Reference Guide
Developer Troubleshooting Guide
Security architecture
Security best practices
Secure your IoT deployment
Security from the ground up
Related
Stream Analytics
Event Hubs
IoT Hub
Microsoft IoT Central
Machine Learning
Resources
Azure Roadmap
FAQ
Connected factory FAQ
IoT Suite learning path
Azure and the Internet of Things
11/10/2017 • 4 min to read • Edit Online
Welcome to Microsoft Azure and the Internet of Things (IoT). This article describes the common characteristics of
an IoT solution in the cloud. IoT solutions require secure, bidirectional communication between devices, possibly
numbering in the millions, and a solution back end. For example, a solution might use automated, predictive
analytics to uncover insights from your device-to-cloud event stream.
NOTE
For an in-depth discussion of IoT architecture, see the Microsoft Azure IoT Reference Architecture.
Device connectivity
In an IoT solution architecture, devices typically send telemetry to the cloud for storage and processing. For
example, in a predictive maintenance scenario, the solution back end might use the stream of sensor data to
determine when a specific pump requires maintenance. Devices can also receive and respond to cloud-to-device
messages by reading messages from a cloud endpoint. In the same example, the solution back end might send
messages to other pumps in the pumping station to begin rerouting flows just before maintenance is due to start.
This procedure makes sure the maintenance engineer could get started as soon as she arrives.
Connecting devices securely and reliably is often the biggest challenge in IoT solutions. This is because IoT devices
have different characteristics as compared to other clients such as browsers and mobile apps. Specifically, IoT
devices:
Are often embedded systems with no human operator (unlike a phone).
Can be deployed in remote locations, where physical access is expensive.
May only be reachable through the solution back end. There is no other way to interact with the device.
May have limited power and processing resources.
May have intermittent, slow, or expensive network connectivity.
May need to use proprietary, custom, or industry-specific application protocols.
Can be created using a large set of popular hardware and software platforms.
In addition to the previous constraints, any IoT solution must also be scalable, secure, and reliable.
Depending on the communication protocol and network availability, a device can either communicate directly, or
through an intermediate gateway, with the cloud. IoT architectures often have a mix of these two communication
patterns.
Data processing and analytics
In modern IoT solutions, data processing can occur in the cloud or on the device side. Device-side processing is
referred as Edge computing. The choice of where to process data depends on factors such as:
Network constraints. If bandwidth between the devices and the cloud is limited, there is an incentive to do
more edge processing.
Response time. If there is a requirement to act on a device in near real time, it may be better to process the
response in the device itself. For example, a robot arm that needs to be stopped in an emergency.
Regulatory environment. Some data cannot be sent to the cloud.
In general, data processing both in the edge and in the cloud are a combination of the following capabilities:
Receiving telemetry at scale from your devices and determining how to process and store that data.
Analyzing the telemetry to provide insights, whether they are in real time or after the fact.
Sending commands from the cloud or a gateway device to a specific device.
Additionally, an IoT cloud back end should provide:
Device registration capabilities that enable you to:
Provision devices.
Control which devices are permitted to connect to your infrastructure.
Device management to control the state of your devices and monitor their activities.
For example, in a predictive maintenance scenario, the cloud back-end stores historical telemetry data. The
solution uses this data to identify potential anomalous behavior on specific pumps before they cause a real
problem. Using data analytics, it can identify that the preventative solution is to send a command back to the
device to take a corrective action. This process generates an automated feedback loop between the device and the
cloud that greatly increases the solution efficiency.
Presentation and business connectivity
The presentation and business connectivity layer allows end users to interact with the IoT solution and the devices.
It enables users to view and analyze the data collected from their devices. These views can take the form of
dashboards or BI reports that can display both historical data or near real-time data. For example, an operator can
check on the status of particular pumping station and see any alerts raised by the system. This layer also allows
integration of the IoT solution back-end with existing line-of-business applications to tie into enterprise business
processes or workflows. For example, a predictive maintenance solution can integrate with a scheduling system to
book an engineer to visit a pumping station when it identifies a pump in need of maintenance.
Next steps
Now that you have learned about the typical IoT Architecture, explore the different implementation options using
Microsoft Azure IoT products in Microsoft Azure IoT options.
To find out more about the individual Azure IoT services, see:
What is Azure IoT Suite?
What is Microsoft IoT Central?
What is Azure IoT Hub?
Compare Azure IoT options
1/17/2018 • 2 min to read • Edit Online
The article Azure and the Internet of Things describes a typical IoT solution architecture with the following layers:
Device connectivity and management
Data processing and analytics
Presentation and business integration
To implement this architecture, Azure IoT offers several options, each appropriate for different sets of customer
requirements:
Azure IoT Suite is an enterprise-grade collection of preconfigured solutions built on Azure Platform-as-a-
Service (PaaS) that enable you to accelerate the development of custom IoT solutions.
Microsoft IoT Central is a Software-as-a-Service (SaaS) solution that uses a model-based approach to
enable you to build enterprise-grade IoT solutions without requiring cloud solution development expertise.
Access to underlying PaaS services You have access to the underlying SaaS. Fully managed solution, the
Azure services to manage them, or underlying services aren't exposed.
replace them as needed.
Flexibility High. The code for the microservices is Medium. You can use the built-in
open source and you can modify it in browser-based user experience to
any way you see fit. Additionally, you customize the solution model and
can customize the deployment aspects of the UI. The infrastructure is
infrastructure. not customizable because the different
components are not exposed.
Skill level Medium-High. You need Java or .NET Low. You need modeling skills to
skills to customize the solution back customize the solution. No coding skills
end. You need JavaScript skills to are required.
customize the visualization.
Get started experience Preconfigured solutions implement Application templates and device
common IoT scenarios. Can be templates provide pre-built models.
deployed in minutes. Can be deployed in minutes.
Pricing You can fine-tune the services to Simple, predictable pricing structure.
control the cost.
The decision of which product to use to build your IoT solution is ultimately determined by:
Your business requirements.
The type of solution you want to build
Your organization's skill set for building and maintaining the solution in the long term.
Next steps
Based on your chosen product and approach, the suggested next steps are:
: What are the Azure IoT preconfigured solutions?
: Microsoft IoT Central.
: Overview of the Azure IoT Hub service.
What is Azure IoT Suite?
1/17/2018 • 5 min to read • Edit Online
NOTE
To deploy a preconfigured solution and learn more about how to customize them, visit Microsoft Azure IoT Suite.
Azure services
When you deploy a preconfigured solution, the provisioning process configures a number of Azure services. The
following table shows the services used in the preconfigured solutions:
Azure IoT Hub. This service provides the device-to-cloud and cloud-to-device messaging capabilities and acts
as the gateway to the cloud and the other key IoT Suite services. The service enables you to receive messages
from your devices at scale, and send commands to your devices. The service also enables you to manage your
devices. For example, you can configure, reboot, or perform a factory reset on one or more devices connected
to the hub.
Azure Event Hubs. This service provides high-volume event ingestion to the cloud. See Comparison of Azure
IoT Hub and Azure Event Hubs.
Azure Time Series Insights. The preconfigured solutions use this service to analyze and display the telemetry
data from your devices.
Azure Container Service. This service hosts and manages the microservices in the preconfigured solutions.
Azure Cosmos DB and Azure Storage for data storage.
Azure Stream Analytics. The predictive maintenance preconfigured solution uses this service to process
incoming telemetry, perform aggregation, and detect events. This preconfigured solution also uses stream
analytics to process informational messages that contain data such as metadata or command responses from
devices.
Azure Web Apps to host the custom application code in the preconfigured solutions.
For an overview of the architecture of a typical IoT solution, see Microsoft Azure and the Internet of Things (IoT).
The following sections describe what's new in the microservices-based preconfigured solutions:
Microservices
The new version of the remote monitoring preconfigured solution uses a microservices architecture. This
preconfigured solution is composed of multiple microservices such as an IoT Hub manager and a Storage
manager. Both Java and .NET versions of each microservice are available to download, along with related
developer documentation. For more information about the microservices, see Remote monitoring architecture.
This microservices architecture is a proven pattern for cloud solutions that:
Is scalable.
Enables extensibility.
Is easy to understand.
Enables individual services to be swapped out for alternatives.
TIP
To learn more about microservice architectures, see .NET Application Architecture and Microservices: An application
revolution powered by the cloud.
When you deploy the new version of remote monitoring, you must select one of the following deployment
options:
Reduced cost version for a demonstration or to test a deployment. All the microservices deploy to a
single Azure virtual machine.
Expanded infrastructure deployment for developing a production deployment. The Azure Container
Service deploys the microservices to multiple Azure virtual machines. Kubernetes orchestrates the Docker
containers that host the individual microservices.
Language choices: Java and .NET
Implementations of each of the microservices are available in both Java and .NET. Like the .NET code, the Java
source code is open source and available for you to customize to your specific requirements:
Remote monitoring .NET GitHub repository
Remote monitoring Java GitHub repository
If you'd like to see other language implementations, add a request to Azure IoT user voice.
React user interface framework
The UI is built using the React javascript library. The source code is open source and available for you to
download and customize.
Next steps
Now that you have an overview of the IoT Suite preconfigured solutions, here are suggested next steps for each
of the preconfigured solutions:
Explore the Azure IoT Suite remote monitoring solution Resource Manager deployment model.
Predictive maintenance preconfigured solution overview.
Get started with the connected factory preconfigured solution.
For more information about IoT solution architectures, see Microsoft Azure IoT services: Reference Architecture.
Deploy the remote monitoring preconfigured
solution
12/13/2017 • 1 min to read • Edit Online
This tutorial shows you how to provision the remote monitoring preconfigured solution. You deploy the solution
from azureiotsuite.com. You can also deploy the solution using the CLI, to learn about this option see Deploy a
preconfigured solution from the command line.
In this tutorial, you learn how to:
Configure the preconfigured solution
Deploy the preconfigured solution
Sign in to the preconfigured solution
Prerequisites
To complete this tutorial, you need an active Azure subscription.
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure
Free Trial.
NOTE
You can delete your remote monitoring solution from this panel when you are finished with it.
3. The remote monitoring solution dashboard displays in your browser.
Next steps
In this tutorial, you learned how to:
Configure the preconfigured solution
Deploy the preconfigured solution
Sign in to the preconfigured solution
Now that you have deployed the remote monitoring solution, the next step is to explore the capabilities of the
solution dashboard.
Explore the capabilities of the remote monitoring
preconfigured solution
12/13/2017 • 8 min to read • Edit Online
This tutorial shows you the key capabilities of the remote monitoring solution. To introduce these capabilities, the
tutorial showcases common customer scenarios using a simulated IoT application for a company called Contoso.
The tutorial helps you understand the typical IoT scenarios the remote monitoring solution provides out-of-the-
box.
In this tutorial, you learn how to:
Visualize and filter devices on the dashboard
Respond to an alarm
Update the firmware in your devices
Organize your assets
Prerequisites
To complete this tutorial, you need a deployed instance of the remote monitoring solution in your Azure
subscription.
If you haven't deployed the remote monitoring solution yet, you should complete the Deploy the remote
monitoring preconfigured solution tutorial.
NOTE
If you used the CLI to deploy the preconfigured solution, the file
contains information about deployment such as the URL to access the deployed sample.
The Contoso sample provisions a set of simulated devices and rules to act on them. Once you understand the
basic scenarios, you can continue exploring more of the solution features in Perform advanced device monitoring
using the remote monitoring solution.
Contoso is a company that manages a variety of assets in different environments. Contoso plans to use the power
of cloud-based IoT applications to remotely monitor and manage multiple assets from a centralized application.
The following sections provide a summary of the initial configuration of the Contoso sample:
NOTE
The Contoso demo is only one way to provision simulated devices and create rules. Other provisioning options include the
creation of your own custom devices. To learn more about how to create your own devices and rules, see Manage and
configure your devices and Detect issues using threshold-based rules.
Contoso devices
Contoso uses different types of smart devices. These devices fulfill different roles for the company, sending
various telemetry streams. Additionally, each device type has different device properties and supported methods.
The following table shows a summary of the provisioned device types:
Engine Tank fuel level, Type, Firmware Location, Floor, Restart, Firmware
Coolant sensor, version, Model Campus Update, Empty tank,
Vibration Fill tank
Elevator Floor, Vibration, Type, Firmware Location, Campus Stop elevator, Start
Temperature version, Model, Geo- elevator, Firmware
location update
NOTE
The Contoso demo sample provisions two devices per type. For each type, one functions correctly within the boundaries
defined as normal by Contoso, and the one has some kind of malfunctioning. In the next section, you learn about the rules
that Contoso defines for the devices. These rules define the boundaries of correct behavior.
Contoso rules
Operators at Contoso know the thresholds that determine whether a device is working correctly. For example, a
chiller is not working correctly if the pressure that it reports is greater than 250 PSI. The following table shows
threshold-based rules Contoso defines for each device type:
Chiller pressure too Alerts if chillers reach P>250 psi Critical Chillers
high higher than normal
pressure levels
Prototyping device Alerts if prototyping T>80° F Critical Prototyping devices
temp too high devices reach higher
than normal
temperature levels
Engine tank empty Alerts if engine fuel F<5 gallons Info Engines
tank goes empty
2. To view the device details and telemetry, click the highlighted chiller on the map. The telemetry shows a
pressure spike:
3. Close .
4. To navigate to the page, choose on the navigation menu.
On the page, you can view the details of the rule that triggered the chiller pressure alarm.
1. The list of notifications shows the number of times the alarm has triggered, acknowledgments, and open
and closed alarms:
2. The first alarm in the list is the most recent one. Click the alarm to view the associated
devices and telemetry. The telemetry shows a pressure spike for the chiller:
You have now identified the issue that triggered the alarm and the associated device. As an operator, the next
steps are to acknowledge the alarm and mitigate the issue.
1. To indicate that you are now working on the alarm, change the to :
2. To act on the chiller, select it and then choose . Select , add a job name
, and choose . These settings create a job that executes immediately:
3. To view the job status, return to the page and view the list of jobs in the view. You can
see the job has run to release the valve pressure on the chiller:
Finally, confirm that the telemetry values from the chiller are back to normal.
1. To view the alarms grid, navigate to the page.
2. To view the device telemetry, select the device for the original alarm on the map, and confirm that is back
to normal.
3. To close the incident, navigate to the page, select the alarm, and set the status to :
Update device firmware
Contoso is testing a new type of device in the field. As part of the testing cycle, you need to ensure that device
firmware updates work correctly. The following steps show you how to use the remote monitoring solution to
update the firmware on multiple devices.
To perform the necessary device management tasks, use the page. Start by filtering for all prototyping
devices:
1. Navigate to the page. Choose the filter in the drop-down:
TIP
Click to manage the available filters.
3. Click the button and then choose . Enter values for and
. Choose to schedule the job to run now:
NOTE
With the simulated devices you can use any URL you like as the value. The simulated devices do not
access the URL.
4. Note how many devices the job affects and choose :
2. Create a filter that includes only devices with the new firmware version:
3. Return to the page and verify that the device has the new firmware version.
Next steps
In this tutorial, you learned to:
Visualize and filter devices on the dashboard
Respond to an alarm
Update the firmware in your devices
Organize your assets
Now that you have explored the remote monitoring solution, the suggested next steps are to learn about the
advanced features of the remote monitoring solution:
Monitor your devices.
Manage your devices.
Automate your solution with rules.
Maintain your solution.
What are the Azure IoT Suite preconfigured
solutions?
11/6/2017 • 7 min to read • Edit Online
The Azure IoT Suite preconfigured solutions are implementations of common IoT solution patterns that you can
deploy to Azure using your subscription. You can use the preconfigured solutions:
As a starting point for your own IoT solutions.
To learn about common patterns in IoT solution design and development.
Each preconfigured solution is a complete, end-to-end implementation that uses simulated devices to generate
telemetry.
You can download the complete source code to customize and extend the solution to meet your specific IoT
requirements.
NOTE
To deploy one of the preconfigured solutions, visit Microsoft Azure IoT Suite. The article Get started with the IoT
preconfigured solutions provides more information about how to deploy and run one of the solutions.
The following table shows how the solutions map to specific IoT features:
Devices
When you deploy the remote monitoring preconfigured solution, four simulated devices are pre-provisioned in
the solution that simulate a cooling device. These simulated devices have a built-in temperature and humidity
model that emits telemetry. These simulated devices are included to:
Illustrate the end-to-end flow of data through the solution.
Provide a convenient source of telemetry.
Provide a target for methods or commands if you are a back-end developer using the solution as a starting
point for a custom implementation.
The simulated devices in the solution can respond to the following cloud-to-device communications:
Methods (direct methods): A two-way communication method where a connected device is expected to respond
immediately.
Commands (cloud-to-device messages): A one-way communication method where a device retrieves the
command from a durable queue.
For a comparison of these different approaches, see Cloud-to-device communications guidance.
When a device first connects to IoT Hub in the preconfigured solution, it sends a device information message to
the hub. This message enumerates the methods the device can respond to. In the remote monitoring
preconfigured solution, simulated devices support these methods:
Initiate Firmware Update: this method initiates an asynchronous task on the device to perform a firmware
update. The asynchronous task uses reported properties to deliver status updates to the solution dashboard.
Reboot: this method causes the simulated device to reboot.
FactoryReset: this method triggers a factory reset on the simulated device.
When a device first connects to IoT Hub in the preconfigured solution, it sends a device information message to
the hub. This message enumerates the commands the device can respond to. In the remote monitoring
preconfigured solution, simulated devices support these commands:
Ping Device: The device responds to this command with an acknowledgement. This command is useful for
checking that the device is still active and listening.
Start Telemetry: Instructs the device to start sending telemetry.
Stop Telemetry: Instructs the device to stop sending telemetry.
Change Set Point Temperature: Controls the simulated temperature telemetry values the device sends. This
command is useful for testing back-end logic.
Diagnostic Telemetry: Controls if the device should send the external temperature as telemetry.
Change Device State: Sets the device state metadata property that the device reports. This command is useful
for testing back-end logic.
You can add more simulated devices to the solution that emit the same telemetry and respond to the same
methods and commands.
In addition to responding to commands and methods, the solution uses device twins. Devices use device twins to
report property values to the solution back end. The solution dashboard uses device twins to set to new desired
property values on devices. For example, during the firmware update process the simulated device reports the
status of the update using reported properties.
IoT Hub
In this preconfigured solution, the IoT Hub instance corresponds to the Cloud Gateway in a typical IoT solution
architecture.
An IoT hub receives telemetry from the devices at a single endpoint. An IoT hub also maintains device-specific
endpoints where each device can retrieve the commands that are sent to it.
The IoT hub makes the received telemetry available through the service-side telemetry read endpoint.
The device management capability of IoT Hub enables you to manage your device properties from the solution
portal and schedule jobs that perform operations such as:
Rebooting devices
Changing device states
Firmware updates
Event processor
In this preconfigured solution, the event processor forms part of the in a typical IoT
solution architecture.
The and ASA jobs send their output to Event hubs for delivery to other back-end services. The
solution uses an EventProcessorHost instance, running in a WebJob, to read the messages from these Event hubs.
The uses:
The data to update the device data in the Cosmos DB database.
The data to invoke the Logic app and update the alerts display in the solution portal.
Solution portal
The solution portal is a web-based UI that is deployed to the cloud as part of the preconfigured solution. It enables
you to:
View telemetry and alarm history in a dashboard.
Provision new devices.
Manage and monitor devices.
Send commands to specific devices.
Invoke methods on specific devices.
Manage rules and actions.
Schedule jobs to run on one or more devices.
In this preconfigured solution, the solution portal forms part of the and part of the
in the typical IoT solution architecture.
Next steps
For more information about IoT solution architectures, see Microsoft Azure IoT services: Reference Architecture.
Now you know what a preconfigured solution is, you can get started by deploying the remote monitoring
preconfigured solution: Get started with the preconfigured solutions.
Frequently asked questions for IoT Suite
1/5/2018 • 4 min to read • Edit Online
NOTE
Don't have a Bing Maps API for Enterprise account? Create one in the Azure portal by clicking + New,
searching for Bing Maps API for Enterprise and follow prompts to create.
NOTE
Microsoft Azure for DreamSpark is now known as Microsoft Imagine for students.
Currently, you cannot create a preconfigured solution with a Microsoft Azure for DreamSpark account. However,
you can create a free trial account for Azure in just a couple of minutes that enables you create a preconfigured
solution.
Can I create a preconfigured solution if I have Cloud Solution Provider (CSP) subscription?
Currently, you cannot create a preconfigured solution with a Cloud Solution Provider (CSP) subscription.
However, you can create a free trial account for Azure in just a couple of minutes that enables you create a
preconfigured solution.
How do I delete an Azure AD tenant?
See Eric Golpe's blog post Walkthrough of Deleting an Azure AD Tenant.
Next steps
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Connected factory preconfigured solution overview
IoT security from the ground up
Get started with the preconfigured solutions
11/6/2017 • 14 min to read • Edit Online
Azure IoT Suite preconfigured solutions combine multiple Azure IoT services to deliver end-to-end solutions that
implement common IoT business scenarios. The remote monitoring preconfigured solution connects to and
monitors your devices. You can use the solution to analyze the stream of data from your devices and to improve
business outcomes by making processes respond automatically to that stream of data.
This tutorial shows you how to provision the remote monitoring preconfigured solution. It also walks you through
the basic features of the preconfigured solution. You can access many of these features from the solution
dashboard that deploys as part of the preconfigured solution:
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User Voice.
Scenario overview
When you deploy the remote monitoring preconfigured solution, it is prepopulated with resources that enable you
to step through a common remote monitoring scenario. In this scenario, several devices connected to the solution
are reporting unexpected temperature values. The following sections show you how to:
Identify the devices sending unexpected temperature values.
Configure these devices to send more detailed telemetry.
Fix the problem by updating the firmware on these devices.
Verify that your action has resolved the issue.
A key feature of this scenario is that you can perform all these actions remotely from the solution dashboard. You
do not need physical access to the devices.
View alarms
The alarm history panel shows you that five devices are reporting higher than expected telemetry values.
NOTE
These alarms are generated by a rule that is included in the preconfigured solution. This rule generates an alert when the
temperature value sent by a device exceeds 60. You can define your own rules and actions by choosing Rules and Actions in
the left-hand menu.
View devices
The devices list shows all the registered devices in the solution. From the device list you can view and edit device
metadata, add or remove devices, and invoke methods on devices. You can filter and sort the list of devices in the
device list. You can also customize the columns shown in the device list.
1. Choose to show the device list for this solution.
2. The device list initially shows 25 simulated devices created by the provisioning process. You can add
additional simulated and physical devices to the solution.
3. To view the details of a device, choose a device in the device list.
2. The device list now shows only devices with a mean temperature value greater than 60.
5. You can monitor the progress of the job on the page in the portal.
NOTE
If you want to change a desired property value for an individual device, use the section in the
panel instead of running a job.
This job sets the value of the desired property in the device twin for all the devices selected by
the filter. The devices retrieve this value from the device twin and update their behavior. When a device retrieves
and processes a desired property from a device twin, it sets the corresponding reported value property.
Invoke methods
While the job runs, you notice in the list of unhealthy devices that all these devices have old (less than version 1.6)
firmware versions.
This firmware version may be the root cause of the unexpected temperature values because you know that other
healthy devices were recently updated to version 2.0. You can use the built-in filter to
identify any devices with old firmware versions. From the portal, you can then remotely update all the devices still
running old firmware versions:
1. Choose to display a list of available filters. Then choose to apply
the filter:
2. The device list now shows only devices with old firmware versions. This list includes the five devices
identified by the filter and three additional devices:
3. Choose , then .
4. Set to .
5. Choose as the .
6. Set the parameter to .
7. Choose . The default is for the job to run now.
NOTE
If you want to invoke a method on an individual device, choose in the panel instead of running a
job.
This job invokes the direct method on all the devices selected by the filter. Devices
respond immediately to IoT Hub and then initiate the firmware update process asynchronously. The devices
provide status information about the firmware update process through reported property values, as shown in the
following screenshots. Choose the icon to update the information in the device and job lists:
NOTE
In a production environment, you can schedule jobs to run during a designated maintenance window.
Scenario review
In this scenario, you identified a potential issue with some of your remote devices using the alarm history on the
dashboard and a filter. You then used the filter and a job to remotely configure the devices to provide more
information to help diagnose the issue. Finally, you used a filter and a job to schedule maintenance on the affected
devices. If you return to the dashboard, you can check that there are no longer any alarms coming from devices in
your solution. You can use a filter to verify that the firmware is up-to-date on all the devices in your solution and
that there are no more unhealthy devices:
Other features
The following sections describe some additional features of the remote monitoring preconfigured solution that are
not described as part of the previous scenario.
Customize columns
You can customize the information shown in the device list by choosing . You can add and remove
columns that display reported property and tag values. You can also reorder and rename columns:
3. The image you selected now displays in the column for the device.
NOTE
The image is stored in blob storage. A tag in the device twin contains a link to the image in blob storage.
Add a device
When you deploy the preconfigured solution, you automatically provision 25 sample devices that you can see in
the device list. These devices are simulated devices running in an Azure WebJob. Simulated devices make it easy
for you to experiment with the preconfigured solution without the need to deploy real, physical devices. If you do
want to connect a real device to the solution, see the Connect your device to the remote monitoring preconfigured
solution tutorial.
The following steps show you how to add a simulated device to the solution:
1. Navigate back to the device list.
2. To add a device, choose in the bottom left corner.
8. You can also view the simulated telemetry from your new device on the dashboard:
Disable and delete a device
You can disable a device, and after it is disabled you can remove it:
Add a rule
There are no rules for the new device you just added. In this section, you add a rule that triggers an alarm when the
temperature reported by the new device exceeds 47 degrees. Before you start, notice that the telemetry history for
the new device on the dashboard shows the device temperature never exceeds 45 degrees.
1. Navigate back to the device list.
2. To add a rule for the device, select your new device in the , and then choose .
3. Create a rule that uses as the data field and uses as the output when the
temperature exceeds 47 degrees:
4. To save your changes, choose .
5. Choose in the device details pane for the new device.
6. Select from the command list and set to 45. Then choose
:
7. Navigate back to the dashboard. After a short time, you will see a new entry in the pane
when the temperature reported by your new device exceeds the 47-degree threshold:
8. You can review and edit all your rules on the page of the dashboard:
9. You can review and edit all the actions that can be taken in response to a rule on the page of the
dashboard:
NOTE
It is possible to define actions that can send an email message or SMS in response to a rule or integrate with a line-of-
business system through a Logic App. For more information, see the Connect Logic App to your Azure IoT Suite Remote
Monitoring preconfigured solution.
Manage filters
In the device list, you can create, save, and reload filters to display a customized list of devices connected to your
hub. To create a filter:
1. Choose the edit filter icon above the list of devices:
2. In the , add the fields, operators, and values to filter the device list. You can add multiple
clauses to refine your filter. Choose to apply the filter:
You can create filters based on device id, device state, desired properties, reported properties, and tags. You add
your own custom tags to a device in the section of the panel, or run a job to update tags on
multiple devices.
NOTE
In the , you can use the to edit the query text directly.
Commands
From the panel, you can send commands to the device. When a device first starts, it sends
information about the commands it supports to the solution. For a discussion of the differences between
commands and methods, see Azure IoT Hub cloud-to-device options.
1. Choose in the panel for the selected device:
2. Select from the command list.
3. Choose .
4. You can see the status of the command in the command history.
The solution tracks the status of each command it sends. Initially the result is . When the device reports
that it has executed the command, the result is set to .
NOTE
To ensure that you delete everything related to the preconfigured solution, delete it on the azureiotsuite.com site and do
not delete the resource group in the portal.
Next Steps
Now that you’ve deployed a working preconfigured solution, you can continue getting started with IoT Suite by
reading the following articles:
Remote monitoring preconfigured solution walkthrough
Connect your device to the remote monitoring preconfigured solution
Permissions on the azureiotsuite.com site
Permissions on the azureiotsuite.com site
12/18/2017 • 6 min to read • Edit Online
AAD roles
The AAD roles control the ability provision preconfigured solutions and manage users in a preconfigured
solution.
You can find more information about administrator roles in AAD in Assigning administrator roles in Azure AD.
The current article focuses on the and the directory roles as used by the
preconfigured solutions.
Global administrator
There can be many global administrators per AAD tenant:
When you create an AAD tenant, you are by default the global administrator of that tenant.
The global administrator can provision a preconfigured solution and is assigned an role for the
application inside their AAD tenant.
If another user in the same AAD tenant creates an application, the default role granted to the global
administrator is .
A global administrator can assign users to roles for applications using the Azure portal.
Domain user
There can be many domain users per AAD tenant:
A domain user can provision a preconfigured solution through the azureiotsuite.com site. By default, the
domain user is granted the role in the provisioned application.
A domain user can create an application using the build.cmd script in the azure-iot-remote-monitoring, azure-
iot-predictive-maintenance, or azure-iot-connected-factory repository. However, the default role granted to
the domain user is , because a domain user does not have permission to assign roles.
If another user in the AAD tenant creates an application, the domain user is assigned the role by
default for that application.
A domain user cannot assign roles for applications; therefore a domain user cannot add users or roles for
users for an application even if they provisioned it.
Guest User
There can be many guest users per AAD tenant. Guest users have a limited set of rights in the AAD tenant. As a
result, guest users cannot provision a preconfigured solution in the AAD tenant.
For more information about users and roles in AAD, see the following resources:
Create users in Azure AD
Assign users to apps
Application roles
The application roles control access to devices in your preconfigured solution.
There are two defined roles and one implicit role defined in a provisioned application:
Has full control to add, manage, remove devices, and modify settings.
Can view devices, rules, actions, jobs, and telemetry.
You can find the permissions assigned to each role in the RolePermissions.cs source file.
Changing application roles for a user
You can use the following procedure to make a user in your Active Directory an administrator of your
preconfigured solution.
You must be an AAD global administrator to change roles for a user:
1. Go to the Azure portal.
2. Select .
3. Make sure you are using the directory you chose on azureiotsuite.com when you provisioned your solution. If
you have multiple directories associated with your subscription, you can switch between them if you click
your account name at the top-right of the portal.
4. Click , then .
5. Show with status. Then search for an application with name of your preconfigured
solution.
6. Click the name of the application that matches your preconfigured solution name.
7. Click .
8. Select the user you want to switch roles.
9. Click and select the role (such as ) you'd like to assign to the user, click the check mark.
FAQ
I'm a service administrator and I'd like to change the directory mapping between my subscription and a
specific AAD tenant. How do I complete this task?
See To add an existing subscription to your Azure AD directory
I'm a domain user/member on the AAD tenant and I've created a preconfigured solution. How do I get
assigned a role for my application?
Ask a global administrator to make you a global administrator on the AAD tenant and then assign roles to users
yourself. Alternatively, ask a global administrator to assign you a role directly. If you'd like to change the AAD
tenant your preconfigured solution has been deployed to, see the next question.
How do I switch the AAD tenant my remote monitoring preconfigured solution and application are assigned
to?
You can run a cloud deployment from https://github.com/Azure/azure-iot-remote-monitoring and redeploy with
a newly created AAD tenant. Because you are, by default, a global administrator when you create an AAD tenant,
you have permissions to add users and assign roles to those users.
1. Create an AAD directory in the Azure portal.
2. Go to https://github.com/Azure/azure-iot-remote-monitoring.
3. Run (For
example, )
4. When prompted, set the to be your newly created tenant instead of your previous tenant.
I want to change a Service Administrator or Co-Administrator when logged in with an organisational account
See the support article Changing Service Administrator and Co-Administrator when logged in with an
organisational account.
Why am I seeing this error? "Your account does not have the proper permissions to create a solution. Please
check with your account administrator or try with a different account."
Look at the following diagram for guidance:
NOTE
If you continue to see the error after validating you are a global administrator on the AAD tenant and a co-administrator
on the subscription, have your account administrator remove the user and reassign necessary permissions in this order.
First, add the user as a global administrator and then add user as a co-administrator on the Azure subscription. If issues
persist, contact Help & Support.
Why am I seeing this error when I have an Azure subscription? "An Azure subscription is required to create
pre-configured solutions. You can create a free trial account in just a couple of minutes."
If you're certain you have an Azure subscription, validate the tenant mapping for your subscription and ensure
the correct tenant is selected in the dropdown. If you’ve validated the desired tenant is correct, follow the
preceding diagram and validate the mapping of your subscription and this AAD tenant.
Next steps
To continue learning about IoT Suite, see how you can customize a preconfigured solution.
Remote monitoring preconfigured solution
walkthrough
11/6/2017 • 9 min to read • Edit Online
The IoT Suite remote monitoring preconfigured solution is an implementation of an end-to-end monitoring
solution for multiple machines running in remote locations. The solution combines key Azure services to provide a
generic implementation of the business scenario. You can use the solution as a starting point for your own
implementation and customize it to meet your own specific business requirements.
This article walks you through some of the key elements of the remote monitoring solution to enable you to
understand how it works. This knowledge helps you to:
Troubleshoot issues in the solution.
Plan how to customize to the solution to meet your own specific requirements.
Design your own IoT solution that uses Azure services.
Logical architecture
The following diagram outlines the logical components of the preconfigured solution:
Simulated devices
In the preconfigured solution, the simulated device represents a cooling device (such as a building air conditioner
or facility air handling unit). When you deploy the preconfigured solution, you also automatically provision four
simulated devices that run in an Azure WebJob. The simulated devices make it easy for you to explore the behavior
of the solution without the need to deploy any physical devices. To deploy a real physical device, see the Connect
your device to the remote monitoring preconfigured solution tutorial.
Device-to-cloud messages
Each simulated device can send the following message types to IoT Hub:
NOTE
The solution stores the list of commands supported by the device in a Cosmos DB database and not in the device twin.
The simulator seeds these properties in simulated devices with sample values. Each time the simulator initializes a
simulated device, the device reports the pre-defined metadata to IoT Hub as reported properties. Reported
properties can only be updated by the device. To change a reported property, you set a desired property in
solution portal. It is the responsibility of the device to:
1. Periodically retrieve desired properties from the IoT hub.
2. Update its configuration with the desired property value.
3. Send the new value back to the hub as a reported property.
From the solution dashboard, you can use desired properties to set properties on a device by using the device twin.
Typically, a device reads a desired property value from the hub to update its internal state and report the change
back as a reported property.
NOTE
The simulated device code only uses the and
desired properties to update the reported properties sent back to IoT Hub. All other
desired property change requests are ignored in the simulated device.
Methods
The simulated devices can handle the following methods (direct methods) invoked from the solution portal
through the IoT hub:
Some methods use reported properties to report on progress. For example, the method
simulates running the update asynchronously on the device. The method returns immediately on the device, while
the asynchronous task continues to send status updates back to the solution dashboard using reported properties.
Commands
The simulated devices can handle the following commands (cloud-to-device messages) sent from the solution
portal through the IoT hub:
ChangeSetPointTemp Changes the set point value around which the random data is
generated
ChangeDeviceState Changes an extended state property for the device and sends
the device info message from the device
NOTE
For a comparison of these commands (cloud-to-device messages) and methods (direct methods), see Cloud-to-device
communications guidance.
IoT Hub
The IoT hub ingests data sent from the devices into the cloud and makes it available to the Azure Stream Analytics
(ASA) jobs. Each stream ASA job uses a separate IoT Hub consumer group to read the stream of messages from
your devices.
The IoT hub in the solution also:
Maintains an identity registry that stores the ids and authentication keys of all the devices permitted to connect
to the portal. You can enable and disable devices through the identity registry.
Sends commands to your devices on behalf of the solution portal.
Invokes methods on your devices on behalf of the solution portal.
Maintains device twins for all registered devices. A device twin stores the property values reported by a device.
A device twin also stores desired properties, set in the solution portal, for the device to retrieve when it next
connects.
Schedules jobs to set properties for multiple devices or invoke methods on multiple devices.
This job sends its output to an Event Hub for further processing.
evaluates incoming temperature and humidity telemetry values against per-device thresholds.
Threshold values are set in the rules editor available in the solution portal. Each device/value pair is stored by
timestamp in a blob which Stream Analytics reads in as . The job compares any non-empty value
against the set threshold for the device. If it exceeds the '>' condition, the job outputs an event that indicates
that the threshold is exceeded and provides the device, value, and timestamp values. This job uses the following
query definition to identify telemetry messages that should trigger an alarm:
The job sends its output to an Event Hub for further processing and saves details of each alert to blob storage from
where the solution portal can read the alert information.
operates on the incoming device telemetry stream in two ways. The first sends all telemetry
messages from the devices to persistent blob storage for long-term storage. The second computes average,
minimum, and maximum humidity values over a five-minute sliding window and sends this data to blob storage.
The solution portal reads the telemetry data from blob storage to populate the charts. This job uses the following
query definition:
Event Hubs
The and ASA jobs output their data to Event Hubs to reliably forward on to the
running in the WebJob.
Azure storage
The solution uses Azure blob storage to persist all the raw and summarized telemetry data from the devices in the
solution. The portal reads the telemetry data from blob storage to populate the charts. To display alerts, the
solution portal reads the data from blob storage that records when telemetry values exceeded the configured
threshold values. The solution also uses blob storage to record the threshold values you set in the solution portal.
WebJobs
In addition to hosting the device simulators, the WebJobs in the solution also host the running in
an Azure WebJob that handles command responses. It uses command response messages to update the device
command history (stored in the Cosmos DB database).
Cosmos DB
The solution uses a Cosmos DB database to store information about the devices connected to the solution. This
information includes the history of commands sent to devices from the solution portal and of methods invoked
from the solution portal.
Solution portal
The solution portal is a web app deployed as part of the preconfigured solution. The key pages in the solution
portal are the dashboard and the device list.
Dashboard
This page in the web app uses PowerBI javascript controls (See PowerBI-visuals repo) to visualize the telemetry
data from the devices. The solution uses the ASA telemetry job to write the telemetry data to blob storage.
Device list
From this page in the solution portal you can:
Provision a new device. This action sets the unique device id and generates the authentication key. It writes
information about the device to both the IoT Hub identity registry and the solution-specific Cosmos DB
database.
Manage device properties. This action includes viewing existing properties and updating with new properties.
Send commands to a device.
View the command history for a device.
Enable and disable devices.
Next steps
The following TechNet blog posts provide more detail about the remote monitoring preconfigured solution:
IoT Suite - Under The Hood - Remote Monitoring
IoT Suite - Remote Monitoring - Adding Live and Simulated Devices
You can continue getting started with IoT Suite by reading the following articles:
Connect your device to the remote monitoring preconfigured solution
Permissions on the azureiotsuite.com site
Connect your Microsoft Azure IoT Raspberry Pi 3
Starter Kit to the remote monitoring solution
11/6/2017 • 1 min to read • Edit Online
The tutorials in this section help you learn how to connect a Raspberry Pi 3 device to the remote monitoring
solution. Choose the tutorial appropriate to your preferred programming language and the whether you have the
sensor hardware available to use with your Raspberry Pi.
The tutorials
Implement firmware update (Advanced) Uses data from a BME280 sensor C, Node.js
connected to your Raspberry Pi. Enables
remote firmware updates on your
Raspberry Pi.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your Raspberry Pi 3 to the remote
monitoring solution and send simulated telemetry
using C
11/6/2017 • 8 min to read • Edit Online
This tutorial shows you how to use the Raspberry Pi 3 to simulate temperature and humidity data to send to the
cloud. The tutorial uses:
Raspbian OS, the C programming language, and the Microsoft Azure IoT SDK for C to implement a sample
device.
The IoT Suite remote monitoring preconfigured solution as the cloud-based back end.
Overview
In this tutorial, you complete the following steps:
Deploy an instance of the remote monitoring preconfigured solution to your Azure subscription. This step
automatically deploys and configures multiple Azure services.
Set up your device to communicate with your computer and the remote monitoring solution.
Update the sample device code to connect to the remote monitoring solution, and send simulated telemetry
that you can view on the solution dashboard.
Prerequisites
To complete this tutorial, you need an active Azure subscription.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
Required software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
Provision the solution
If you haven't already provisioned the remote monitoring preconfigured solution in your account:
1. Log on to azureiotsuite.com using your Azure account credentials, and click to create a solution.
2. Click on the tile.
3. Enter a for your remote monitoring preconfigured solution.
4. Select the and you want to use to provision the solution.
5. Click to begin the provisioning process. This process typically takes several minutes to run.
Wait for the provisioning process to complete
1. Click the tile for your solution with status.
2. Notice the as Azure services are deployed in your Azure subscription.
3. Once provisioning completes, the status changes to .
4. Click the tile to see the details of your solution in the right-hand pane.
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User Voice.
WARNING
The remote monitoring solution provisions a set of Azure services in your Azure subscription. The deployment reflects a real
enterprise architecture. To avoid unnecessary Azure consumption charges, delete your instance of the preconfigured solution
at azureiotsuite.com when you have finished with it. If you need the preconfigured solution again, you can easily recreate it.
For more information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT
Suite preconfigured solutions for demo purposes.
Add a device
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
If you haven't already done so, add a custom device to your remote monitoring solution. Complete the following
steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now
receive telemetry from your device and invoke methods on the device.
NOTE
The SD card included in the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 already has NOOBS installed. You can boot the
Raspberry Pi from this card and choose to install the Raspbian OS.
Replace the placeholder values with the device and IoT Hub information you created and saved at the start of this
tutorial. Save your changes ( , ) and exit the editor ( ).
You can now build the updated sample solution on the Raspberry Pi:
You can now run the sample program on the Raspberry Pi. Enter the command:
The following sample output is an example of the output you see at the command prompt on the Raspberry Pi:
You can switch the LED on and off using the method with a set to
for on or for off.
WARNING
If you leave the remote monitoring solution running in your Azure account, you are billed for the time it runs. For more
information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT Suite
preconfigured solutions for demo purposes. Delete the preconfigured solution from your Azure account when you have
finished using it.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your Raspberry Pi 3 to the remote
monitoring solution and send telemetry from a real
sensor using C
11/6/2017 • 9 min to read • Edit Online
This tutorial shows you how to use the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 to develop a temperature
and humidity reader that can communicate with the cloud. The tutorial uses:
Raspbian OS, the C programming language, and the Microsoft Azure IoT SDK for C to implement a sample
device.
The IoT Suite remote monitoring preconfigured solution as the cloud-based back end.
Overview
In this tutorial, you complete the following steps:
Deploy an instance of the remote monitoring preconfigured solution to your Azure subscription. This step
automatically deploys and configures multiple Azure services.
Set up your device and sensors to communicate with your computer and the remote monitoring solution.
Update the sample device code to connect to the remote monitoring solution, and send telemetry that you can
view on the solution dashboard.
Prerequisites
To complete this tutorial, you need an active Azure subscription.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
Required software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
BME280 sensor
Breadboard
Jumper wires
Resistors
LEDs
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User Voice.
WARNING
The remote monitoring solution provisions a set of Azure services in your Azure subscription. The deployment reflects a real
enterprise architecture. To avoid unnecessary Azure consumption charges, delete your instance of the preconfigured solution
at azureiotsuite.com when you have finished with it. If you need the preconfigured solution again, you can easily recreate it.
For more information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT
Suite preconfigured solutions for demo purposes.
Add a device
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
If you haven't already done so, add a custom device to your remote monitoring solution. Complete the following
steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now
receive telemetry from your device and invoke methods on the device.
NOTE
The SD card included in the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 already has NOOBS installed. You can boot the
Raspberry Pi from this card and choose to install the Raspbian OS.
The following table summarizes the connections from the Raspberry Pi to the components on the breadboard:
Replace the placeholder values with the device and IoT Hub information you created and saved at the start of this
tutorial. Save your changes ( , ) and exit the editor ( ).
You can now build the updated sample solution on the Raspberry Pi:
You can now run the sample program on the Raspberry Pi. Enter the command:
The following sample output is an example of the output you see at the command prompt on the Raspberry Pi:
WARNING
If you leave the remote monitoring solution running in your Azure account, you are billed for the time it runs. For more
information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT Suite
preconfigured solutions for demo purposes. Delete the preconfigured solution from your Azure account when you have
finished using it.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your Raspberry Pi 3 to the remote
monitoring solution and enable remote firmware
updates using C
11/6/2017 • 10 min to read • Edit Online
This tutorial shows you how to use the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 to:
Develop a temperature and humidity reader that can communicate with the cloud.
Enable and perform a remote firmware update to update the client application on the Raspberry Pi.
The tutorial uses:
Raspbian OS, the C programming language, and the Microsoft Azure IoT SDK for C to implement a sample
device.
The IoT Suite remote monitoring preconfigured solution as the cloud-based back end.
Overview
In this tutorial, you complete the following steps:
Deploy an instance of the remote monitoring preconfigured solution to your Azure subscription. This step
automatically deploys and configures multiple Azure services.
Set up your device and sensors to communicate with your computer and the remote monitoring solution.
Update the sample device code to connect to the remote monitoring solution, and send telemetry that you can
view on the solution dashboard.
Use the sample device code to update the client application.
Prerequisites
To complete this tutorial, you need an active Azure subscription.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
Required software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
BME280 sensor
Breadboard
Jumper wires
Resistors
LEDs
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User Voice.
WARNING
The remote monitoring solution provisions a set of Azure services in your Azure subscription. The deployment reflects a real
enterprise architecture. To avoid unnecessary Azure consumption charges, delete your instance of the preconfigured
solution at azureiotsuite.com when you have finished with it. If you need the preconfigured solution again, you can easily
recreate it. For more information about reducing consumption while the remote monitoring solution runs, see Configuring
Azure IoT Suite preconfigured solutions for demo purposes.
Add a device
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
If you haven't already done so, add a custom device to your remote monitoring solution. Complete the following
steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now
receive telemetry from your device and invoke methods on the device.
NOTE
The SD card included in the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 already has NOOBS installed. You can boot the
Raspberry Pi from this card and choose to install the Raspbian OS.
The following table summarizes the connections from the Raspberry Pi to the components on the breadboard:
Replace the placeholder values with the device ID and IoT Hub information you created and saved at the start of
this tutorial.
When you are done, the contents of the deviceinfo file should look like the following example:
You can now build the sample solution on the Raspberry Pi:
You can now run the sample program on the Raspberry Pi. Enter the command:
The following sample output is an example of the output you see at the command prompt on the Raspberry Pi:
NOTE
The remote monitoring app restarts silently when the update completes. Use the command to verify it is
running. If you want to terminate the process, use the command with the process id.
2. You can view the status of the firmware update, as reported by the device, in the solution portal. The
following screenshot shows the status and duration of each stage of the update process, and the new
firmware version:
If you navigate back to the dashboard, you can verify the device is still sending telemetry following the
firmware update.
WARNING
If you leave the remote monitoring solution running in your Azure account, you are billed for the time it runs. For more
information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT Suite
preconfigured solutions for demo purposes. Delete the preconfigured solution from your Azure account when you have
finished using it.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your Raspberry Pi 3 to the remote
monitoring solution and send simulated telemetry
using Node.js
11/6/2017 • 8 min to read • Edit Online
This tutorial shows you how to use the Raspberry Pi 3 to simulate temperature and humidity data to send to the
cloud. The tutorial uses:
Raspbian OS, the Node.js programming language, and the Microsoft Azure IoT SDK for Node.js to implement a
sample device.
The IoT Suite remote monitoring preconfigured solution as the cloud-based back end.
Overview
In this tutorial, you complete the following steps:
Deploy an instance of the remote monitoring preconfigured solution to your Azure subscription. This step
automatically deploys and configures multiple Azure services.
Set up your device to communicate with your computer and the remote monitoring solution.
Update the sample device code to connect to the remote monitoring solution, and send simulated telemetry
that you can view on the solution dashboard.
Prerequisites
To complete this tutorial, you need an active Azure subscription.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
Required software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
Provision the solution
If you haven't already provisioned the remote monitoring preconfigured solution in your account:
1. Log on to azureiotsuite.com using your Azure account credentials, and click to create a solution.
2. Click on the tile.
3. Enter a for your remote monitoring preconfigured solution.
4. Select the and you want to use to provision the solution.
5. Click to begin the provisioning process. This process typically takes several minutes to run.
Wait for the provisioning process to complete
1. Click the tile for your solution with status.
2. Notice the as Azure services are deployed in your Azure subscription.
3. Once provisioning completes, the status changes to .
4. Click the tile to see the details of your solution in the right-hand pane.
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User
Voice.
WARNING
The remote monitoring solution provisions a set of Azure services in your Azure subscription. The deployment reflects a real
enterprise architecture. To avoid unnecessary Azure consumption charges, delete your instance of the preconfigured
solution at azureiotsuite.com when you have finished with it. If you need the preconfigured solution again, you can easily
recreate it. For more information about reducing consumption while the remote monitoring solution runs, see Configuring
Azure IoT Suite preconfigured solutions for demo purposes.
Add a device
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
If you haven't already done so, add a custom device to your remote monitoring solution. Complete the following
steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now
receive telemetry from your device and invoke methods on the device.
NOTE
The SD card included in the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 already has NOOBS installed. You can boot
the Raspberry Pi from this card and choose to install the Raspbian OS.
2. Use the following command to download the Node.js binaries to your Raspberry Pi:
3. Use the following command to install the binaries:
4. Use the following command to verify you have installed Node.js v6.10.2 successfully:
Replace the placeholder values with the device and IoT Hub information you created and saved at the start of this
tutorial. Save your changes ( , ) and exit the editor ( ).
You can now run the sample program on the Raspberry Pi. Enter the command:
The following sample output is an example of the output you see at the command prompt on the Raspberry Pi:
Press to exit the program at any time.
WARNING
If you leave the remote monitoring solution running in your Azure account, you are billed for the time it runs. For more
information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT Suite
preconfigured solutions for demo purposes. Delete the preconfigured solution from your Azure account when you have
finished using it.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your Raspberry Pi 3 to the remote
monitoring solution and send telemetry from a real
sensor using Node.js
11/6/2017 • 9 min to read • Edit Online
This tutorial shows you how to use the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 to develop a temperature
and humidity reader that can communicate with the cloud. The tutorial uses:
Raspbian OS, the Node.js programming language, and the Microsoft Azure IoT SDK for Node.js to implement a
sample device.
The IoT Suite remote monitoring preconfigured solution as the cloud-based back end.
Overview
In this tutorial, you complete the following steps:
Deploy an instance of the remote monitoring preconfigured solution to your Azure subscription. This step
automatically deploys and configures multiple Azure services.
Set up your device and sensors to communicate with your computer and the remote monitoring solution.
Update the sample device code to connect to the remote monitoring solution, and send telemetry that you can
view on the solution dashboard.
Prerequisites
To complete this tutorial, you need an active Azure subscription.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
Required software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
BME280 sensor
Breadboard
Jumper wires
Resistors
LEDs
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User
Voice.
WARNING
The remote monitoring solution provisions a set of Azure services in your Azure subscription. The deployment reflects a real
enterprise architecture. To avoid unnecessary Azure consumption charges, delete your instance of the preconfigured
solution at azureiotsuite.com when you have finished with it. If you need the preconfigured solution again, you can easily
recreate it. For more information about reducing consumption while the remote monitoring solution runs, see Configuring
Azure IoT Suite preconfigured solutions for demo purposes.
Add a device
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
If you haven't already done so, add a custom device to your remote monitoring solution. Complete the following
steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now
receive telemetry from your device and invoke methods on the device.
NOTE
The SD card included in the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 already has NOOBS installed. You can boot
the Raspberry Pi from this card and choose to install the Raspbian OS.
The following table summarizes the connections from the Raspberry Pi to the components on the breadboard:
2. Use the following command to download the Node.js binaries to your Raspberry Pi:
4. Use the following command to verify you have installed Node.js v6.10.2 successfully:
Replace the placeholder values with the device and IoT Hub information you created and saved at the start of this
tutorial. Save your changes ( , ) and exit the editor ( ).
You can now run the sample program on the Raspberry Pi. Enter the command:
The following sample output is an example of the output you see at the command prompt on the Raspberry Pi:
WARNING
If you leave the remote monitoring solution running in your Azure account, you are billed for the time it runs. For more
information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT Suite
preconfigured solutions for demo purposes. Delete the preconfigured solution from your Azure account when you have
finished using it.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your Raspberry Pi 3 to the remote
monitoring solution and enable remote firmware
updates using Node.js
11/6/2017 • 11 min to read • Edit Online
This tutorial shows you how to use the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 to:
Develop a temperature and humidity reader that can communicate with the cloud.
Enable and perform a remote firmware update to update the client application on the Raspberry Pi.
The tutorial uses:
Raspbian OS, the Node.js programming language, and the Microsoft Azure IoT SDK for Node.js to implement a
sample device.
The IoT Suite remote monitoring preconfigured solution as the cloud-based back end.
Overview
In this tutorial, you complete the following steps:
Deploy an instance of the remote monitoring preconfigured solution to your Azure subscription. This step
automatically deploys and configures multiple Azure services.
Set up your device and sensors to communicate with your computer and the remote monitoring solution.
Update the sample device code to connect to the remote monitoring solution, and send telemetry that you can
view on the solution dashboard.
Use the sample device code to update the client application.
Prerequisites
To complete this tutorial, you need an active Azure subscription.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
Required software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
BME280 sensor
Breadboard
Jumper wires
Resistors
LEDs
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User
Voice.
WARNING
The remote monitoring solution provisions a set of Azure services in your Azure subscription. The deployment reflects a real
enterprise architecture. To avoid unnecessary Azure consumption charges, delete your instance of the preconfigured
solution at azureiotsuite.com when you have finished with it. If you need the preconfigured solution again, you can easily
recreate it. For more information about reducing consumption while the remote monitoring solution runs, see Configuring
Azure IoT Suite preconfigured solutions for demo purposes.
Add a device
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
If you haven't already done so, add a custom device to your remote monitoring solution. Complete the following
steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now
receive telemetry from your device and invoke methods on the device.
NOTE
The SD card included in the Microsoft Azure IoT Starter Kit for Raspberry Pi 3 already has NOOBS installed. You can boot
the Raspberry Pi from this card and choose to install the Raspbian OS.
The following table summarizes the connections from the Raspberry Pi to the components on the breadboard:
2. Use the following command to download the Node.js binaries to your Raspberry Pi:
4. Use the following command to verify you have installed Node.js v6.10.2 successfully:
Replace the placeholder values with the device id and IoT Hub information you created and saved at the start of
this tutorial.
When you are done, the contents of the deviceinfo file should look like the following example:
Save your changes ( , ) and exit the editor ( ).
You can now run the sample program on the Raspberry Pi. Enter the command:
The following sample output is an example of the output you see at the command prompt on the Raspberry Pi:
NOTE
The remote monitoring app restarts silently when the update completes. Use the command to verify it is
running. If you want to terminate the process, use the command with the process id.
2. You can view the status of the firmware update, as reported by the device, in the solution portal. The
following screenshot shows the status and duration of each stage of the update process, and the new
firmware version:
If you navigate back to the dashboard, you can verify the device is still sending telemetry following the
firmware update.
WARNING
If you leave the remote monitoring solution running in your Azure account, you are billed for the time it runs. For more
information about reducing consumption while the remote monitoring solution runs, see Configuring Azure IoT Suite
preconfigured solutions for demo purposes. Delete the preconfigured solution from your Azure account when you have
finished using it.
Next steps
Visit the Azure IoT Dev Center for more samples and documentation on Azure IoT.
Connect your device to the remote monitoring
preconfigured solution (Windows)
11/6/2017 • 11 min to read • Edit Online
Scenario overview
In this scenario, you create a device that sends the following telemetry to the remote monitoring preconfigured
solution:
External temperature
Internal temperature
Humidity
For simplicity, the code on the device generates sample values, but we encourage you to extend the sample by
connecting real sensors to your device and sending real telemetry.
The device is also able to respond to methods invoked from the solution dashboard and desired property values
set in the solution dashboard.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free
trial account in just a couple of minutes. For details, see Azure Free Trial.
WARNING
The preconfigured solutions use billable Azure services. Be sure to remove the preconfigured solution from your
subscription when you are done with it to avoid any unnecessary charges. You can completely remove a preconfigured
solution from your subscription by visiting the https://www.azureiotsuite.com/ page.
When the provisioning process for the remote monitoring solution finishes, click to open the solution
dashboard in your browser.
Provision your device in the remote monitoring solution
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need to know the device credentials
when you create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
2. In the panel, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now receive telemetry
from your device and invoke methods on the device.
2. Copy the parson.h and parson.c files from the local copy of the Parson repository to your
project folder.
3. In Visual Studio, right-click the project, click , and then click .
4. In the dialog, select the parson.h and parson.c files in the project folder.
Then click to add these two files to your project.
5. In Visual Studio, open the RMDevice.c file. Replace the existing statements with the following
code:
NOTE
Now you can verify that your project has the correct dependencies set up by building it.
2. Add the following functions that handle the direct methods invoked through the IoT hub. These direct
methods are defined in the model:
3. Add the following function that sends a message to the preconfigured solution:
4. Add the following callback handler that runs when the device has sent new reported property values to the
preconfigured solution:
5. Add the following function to connect your device to the preconfigured solution in the cloud, and exchange
data. This function performs the following steps:
Initializes the platform.
Registers the Contoso namespace with the serialization library.
Initializes the client with the device connection string.
Create an instance of the model.
Creates and sends reported property values.
Sends a object.
Creates a loop to send telemetry every second.
Deinitializes all resources.
For reference, here is a sample message sent to the preconfigured solution:
3. Click to return to the dashboard, select your device in the drop-down to view
its telemetry. The telemetry from the sample application is 50 units for internal temperature, 55 units for
external temperature, and 50 units for humidity.
Invoke a method on your device
The dashboard in the remote monitoring solution enables you to invoke methods on your devices through IoT
Hub. For example, in the remote monitoring solution you can invoke a method to simulate rebooting a device.
1. In the remote monitoring solution dashboard, click in the left-hand panel to navigate to the
.
2. Click for your device in the .
3. In the panel, click .
5. You see a message in the console running your device code when the device handles the method. The
results of the method are added to the history in the solution portal:
Next steps
The article Customizing preconfigured solutions describes some ways you can extend this sample. Possible
extensions include using real sensors and implementing additional commands.
You can learn more about the permissions on the azureiotsuite.com site.
Connect your device to the remote monitoring
preconfigured solution (Linux)
11/6/2017 • 11 min to read • Edit Online
Scenario overview
In this scenario, you create a device that sends the following telemetry to the remote monitoring preconfigured
solution:
External temperature
Internal temperature
Humidity
For simplicity, the code on the device generates sample values, but we encourage you to extend the sample by
connecting real sensors to your device and sending real telemetry.
The device is also able to respond to methods invoked from the solution dashboard and desired property values
set in the solution dashboard.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free trial
account in just a couple of minutes. For details, see Azure Free Trial.
WARNING
The preconfigured solutions use billable Azure services. Be sure to remove the preconfigured solution from your subscription
when you are done with it to avoid any unnecessary charges. You can completely remove a preconfigured solution from your
subscription by visiting the https://www.azureiotsuite.com/ page.
When the provisioning process for the remote monitoring solution finishes, click to open the solution
dashboard in your browser.
Provision your device in the remote monitoring solution
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need to know the device credentials
when you create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
2. In the panel, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now receive telemetry
from your device and invoke methods on the device.
2. Add the following functions that handle the direct methods invoked through the IoT hub. These direct
methods are defined in the model:
3. Add the following function that sends a message to the preconfigured solution:
4. Add the following callback handler that runs when the device has sent new reported property values to the
preconfigured solution:
5. Add the following function to connect your device to the preconfigured solution in the cloud, and exchange
data. This function performs the following steps:
Initializes the platform.
Registers the Contoso namespace with the serialization library.
Initializes the client with the device connection string.
Create an instance of the model.
Creates and sends reported property values.
Sends a object.
Creates a loop to send telemetry every second.
Deinitializes all resources.
For reference, here is a sample message sent to the preconfigured solution:
3. In the folder, create a folder to store the make files that CMake generates and then
run the and commands as follows:
3. Click to return to the dashboard, select your device in the drop-down to view
its telemetry. The telemetry from the sample application is 50 units for internal temperature, 55 units for
external temperature, and 50 units for humidity.
Invoke a method on your device
The dashboard in the remote monitoring solution enables you to invoke methods on your devices through IoT
Hub. For example, in the remote monitoring solution you can invoke a method to simulate rebooting a device.
1. In the remote monitoring solution dashboard, click in the left-hand panel to navigate to the
.
2. Click for your device in the .
3. In the panel, click .
5. You see a message in the console running your device code when the device handles the method. The
results of the method are added to the history in the solution portal:
Next steps
The article Customizing preconfigured solutions describes some ways you can extend this sample. Possible
extensions include using real sensors and implementing additional commands.
You can learn more about the permissions on the azureiotsuite.com site.
Connect your device to the remote monitoring
preconfigured solution (Node.js)
11/6/2017 • 7 min to read • Edit Online
Scenario overview
In this scenario, you create a device that sends the following telemetry to the remote monitoring preconfigured
solution:
External temperature
Internal temperature
Humidity
For simplicity, the code on the device generates sample values, but we encourage you to extend the sample by
connecting real sensors to your device and sending real telemetry.
The device is also able to respond to methods invoked from the solution dashboard and desired property values
set in the solution dashboard.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free trial
account in just a couple of minutes. For details, see Azure Free Trial.
WARNING
The preconfigured solutions use billable Azure services. Be sure to remove the preconfigured solution from your subscription
when you are done with it to avoid any unnecessary charges. You can completely remove a preconfigured solution from your
subscription by visiting the https://www.azureiotsuite.com/ page.
When the provisioning process for the remote monitoring solution finishes, click to open the solution
dashboard in your browser.
Provision your device in the remote monitoring solution
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need to know the device credentials
when you create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution dashboard. You include the device credentials in your client
application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps in the solution dashboard:
1. In the lower left-hand corner of the dashboard, click .
2. In the panel, click .
5. Select your device in the device list in the solution dashboard. Then, in the panel, click
. The status of your device is now . The remote monitoring solution can now receive telemetry
from your device and invoke methods on the device.
5. Add the following variable declarations after the statements. Replace the placeholder values
[Device Id] and [Device Key] with values you noted for your device in the remote monitoring solution
dashboard. Use the IoT Hub Hostname from the solution dashboard to replace [IoTHub Name]. For example,
if your IoT Hub Hostname is , replace [IoTHub Name] with :
8. Add the following helper function to use to randomize the telemetry values:
9. Add the following definition for the object the device sends on startup:
10. Add the following definition for the device twin reported values. This definition includes descriptions of the
direct methods the device supports:
11. Add the following function to handle the direct method call:
12. Add the following function to handle the direct method call. This direct method
uses a parameter to specify the location of the firmware image to download, and initiates the firmware
update on the device asynchronously:
13. Add the following code to create a client instance:
3. Click to return to the dashboard, select your device in the drop-down to view
its telemetry. The telemetry from the sample application is 50 units for internal temperature, 55 units for
external temperature, and 50 units for humidity.
5. You see a message in the console running your device code when the device handles the method. The
results of the method are added to the history in the solution portal:
Next steps
The article Customizing preconfigured solutions describes some ways you can extend this sample. Possible
extensions include using real sensors and implementing additional commands.
You can learn more about the permissions on the azureiotsuite.com site.
Tutorial: Connect Logic App to your Azure IoT Suite
Remote Monitoring preconfigured solution
11/20/2017 • 5 min to read • Edit Online
The Microsoft Azure IoT Suite remote monitoring preconfigured solution is a great way to get started quickly with
an end-to-end feature set that exemplifies an IoT solution. This tutorial walks you through how to add Logic App to
your Microsoft Azure IoT Suite remote monitoring preconfigured solution. These steps demonstrate how you can
take your IoT solution even further by connecting it to a business process.
If you’re looking for a walkthrough on how to provision a remote monitoring preconfigured solution, see Tutorial:
Get started with the IoT preconfigured solutions.
Before you start this tutorial, you should:
Provision the remote monitoring preconfigured solution in your Azure subscription.
Create a SendGrid account to enable you to send an email that triggers your business process. You can sign up
for a free trial account at SendGrid by clicking . After you have registered for your free trial account,
you need to create an API key in SendGrid that grants permissions to send mail. You need this API key later in
the tutorial.
To complete this tutorial, you need Visual Studio 2015 or Visual Studio 2017 to modify the actions in the
preconfigured solution back end.
Assuming you’ve already provisioned your remote monitoring preconfigured solution, navigate to the resource
group for that solution in the Azure portal. The resource group has the same name as the solution name you chose
when you provisioned your remote monitoring solution. In the resource group, you can see all the provisioned
Azure resources for your solution. The following screenshot shows an example blade for a
remote monitoring preconfigured solution:
To begin, set up the logic app to use with the preconfigured solution.
NOTE
You can copy the URL for the HTTP post after you save the logic app, but first you must add an action.
10. Enter a name for the connection, such as , enter the you created
when you set up your SendGrid account, and click .
11. Add email addresses you own to both the and fields. Add
to the field. In the field, add
You can add , , and
by clicking in the section.
12. Click in the top menu.
13. Click the trigger and copy the value. You need this URL later in this tutorial.
NOTE
Logic Apps enable you to run many different types of action including actions in Office 365.
2. In Visual Studio, open the from the local copy of the repository.
3. Open the file in the folder.
4. Update the dictionary with the you noted from your Logic App as follows:
5. Save the changes in solution and exit Visual Studio.
When the build script runs, be sure to use the same Azure account, subscription, region, and Active Directory
instance you used when you provisioned the solution.
NOTE
The Logic App continues to trigger every time the threshold is met. To avoid unnecessary emails, you can either disable the
rules in your solution portal or disable the Logic App in the Azure portal.
In addition to receiving emails, you can also see when the Logic App runs in the portal:
Next steps
Now that you've used a Logic App to connect the preconfigured solution to a business process, you can learn more
about the options for customizing the preconfigured solutions:
Use dynamic telemetry with the remote monitoring preconfigured solution
Device information metadata in the remote monitoring preconfigured solution
Customize a preconfigured solution
11/20/2017 • 7 min to read • Edit Online
The preconfigured solutions provided with the Azure IoT Suite demonstrate the services within the suite working
together to deliver an end-to-end solution. From this starting point, there are various places in which you can
extend and customize the solution for specific scenarios. The following sections describe these common
customization points.
NOTE
The remote monitoring dashboard depends on specific data, so altering the jobs can cause the dashboard to fail.
This method updates the telemetry point temperature and then reports the change back to IoT Hub by setting a
reported property.
You can add your own handlers for your own properties by following the pattern in the preceding example.
You must also bind the desired property to the handler as shown in the following example from the
constructor:
For a list of supported parameter types, see the class in the Infrastructure project.
To delete a method, set the method signature to in the reported properties.
NOTE
The solution back end only updates information about supported methods when it receives a device information message
from the device.
The following code sample from the class in the Common project shows how to add a
method to the list of in the reported properties sent by the device:
This code snippet adds details of the method including text to display in the solution
portal and details of the required method parameters.
The simulator sends reported properties, including the list of supported methods, to IoT Hub when the simulator
starts.
Add a handler to the simulator code for each method it supports. You can see the existing handlers in the
class in the Simulator.WebJob project. The following example shows the handler for
method:
Method handler names must start with followed by the name of the method. The
parameter contains any parameters passed with the method invocation from the solution back end. The return
value must be of type . The utility method helps you create
the return value.
Inside the method handler, you could:
Start an asynchronous task.
Retrieve desired properties from the device twin in IoT Hub.
Update a single reported property using the method in the class.
Update multiple reported properties by creating a instance and calling the
method.
The preceding firmware update example performs the following steps:
Checks the device is able to accept the firmware update request.
Asynchronously initiates the firmware update operation and resets the telemetry when the operation is
complete.
Immediately returns the "FirmwareUpdate accepted" message to indicate the request was accepted by the
device.
Build and use your own (physical) device
The Azure IoT SDKs provide libraries for connecting numerous device types (languages and operating systems)
into IoT solutions.
Feedback
Do you have a customization you'd like to see covered in this document? Add feature suggestions to User Voice,
or comment on this article.
Next steps
To learn more about the options for customizing the preconfigured solutions, see:
Connect Logic App to your Azure IoT Suite Remote Monitoring preconfigured solution
Use dynamic telemetry with the remote monitoring preconfigured solution
Device information metadata in the remote monitoring preconfigured solution
Customize how the connected factory solution displays data from your OPC UA servers
Use dynamic telemetry with the remote monitoring
preconfigured solution
11/6/2017 • 6 min to read • Edit Online
Dynamic telemetry enables you to visualize any telemetry sent to the remote monitoring preconfigured solution.
The simulated devices that deploy with the preconfigured solution send temperature and humidity telemetry,
which you can visualize on the dashboard. If you customize existing simulated devices, create new simulated
devices, or connect physical devices to the preconfigured solution you can send other telemetry values such as the
external temperature, RPM, or windspeed. You can then visualize this additional telemetry on the dashboard.
This tutorial uses a simple Node.js simulated device that you can easily modify to experiment with dynamic
telemetry.
To complete this tutorial, you’ll need:
An active Azure subscription. If you don’t have an account, you can create a free trial account in just a couple of
minutes. For details, see Azure Free Trial.
Node.js version 0.12.x or later.
You can complete this tutorial on any operating system, such as Windows or Linux, where you can install Node.js.
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User Voice.
6. Replace with your device connection string. Use the values for your
IoT Hub hostname, device id, and device key that you made a note of in step 1. A device connection string
has the following format:
If your IoT Hub hostname is and your device id is , your connection string looks like the
following snippet:
7. Save the file. Run the following commands in a shell or command prompt in the folder that contains these
files to install the necessary packages and then run the sample application:
4. Add the new rpm value to the JSON payload the device sends to IoT Hub:
6. Observe the new RPM telemetry type that displays on the chart in the dashboard:
NOTE
You may need to disable and then enable the Node.js device on the page in the dashboard to see the change
immediately.
NOTE
The remote monitoring solution uses a case-insensitive match to compare the metadata definition with data in the telemetry
stream.
Adding a definition as shown in the preceding code snippet does not change the behavior of the
dashboard. However, the metadata can also include a attribute to customize the display in the
dashboard. Update the metadata definition as shown in the following snippet:
The following screenshot shows how this change modifies the chart legend on the dashboard:
NOTE
You may need to disable and then enable the Node.js device on the page in the dashboard to see the change
immediately.
NOTE
You may need to disable and then enable the Node.js device on the page in the dashboard to see the change
immediately.
Handle errors
For a data stream to display on the chart, its in the metadata must match the data type of the
telemetry values. For example, if the metadata specifies that the of humidity data is and a is
found in the telemetry stream then the humidity telemetry does not display on the chart. However, the
values are still stored and made available for any back-end processing.
Next steps
Now that you've seen how to use dynamic telemetry, you can learn more about how the preconfigured solutions
use device information: Device information metadata in the remote monitoring preconfigured solution.
Create a custom rule in the remote monitoring
preconfigured solution
11/6/2017 • 8 min to read • Edit Online
Introduction
In the preconfigured solutions, you can configure rules that trigger when a telemetry value for a device reaches a
specific threshold. Use dynamic telemetry with the remote monitoring preconfigured solution describes how you
can add custom telemetry values, such as ExternalTemperature to your solution. This article shows you how to
create custom rule for dynamic telemetry types in your solution.
This tutorial uses a simple Node.js simulated device to generate dynamic telemetry to send to the preconfigured
solution back end. You then add custom rules in the Visual Studio solution and deploy this
customized back end to your Azure subscription.
To complete this tutorial, you need:
An active Azure subscription. If you don’t have an account, you can create a free trial account in just a couple of
minutes. For details, see Azure Free Trial.
Node.js version 0.12.x or later to create a simulated device.
Visual Studio 2015 or Visual Studio 2017 to modify the preconfigured solution back end with your new rules.
NOTE
If you are encountering issues deploying the pre-configured solution, review Permissions on the azureiotsuite.com site and
the FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Give us feature suggestions on User Voice.
Make a note of the solution name you chose for your deployment. You need this solution name later in this tutorial.
6. Replace with your device connection string. Use the values for your
IoT Hub hostname, device id, and device key that you made a note of in step 1. A device connection string
has the following format:
If your IoT Hub hostname is and your device id is , your connection string looks like the
following snippet:
7. Save the file. Run the following commands in a shell or command prompt in the folder that contains these
files to install the necessary packages and then run the sample application:
2. In Visual Studio, open the RemoteMonitoring.sln file from your local copy of the
repository.
3. Open the file Infrastructure\Models\DeviceRuleBlobEntity.cs and add an property as
follows:
Additional information
Changing the operator is more complex and goes beyond the steps outlined in this tutorial. While you can change
the Stream Analytics job to use whatever operator you like, reflecting that operator in the solution portal is a more
complex task.
Next steps
Now that you've seen how to create custom rules, you can learn more about the preconfigured solutions:
Connect Logic App to your Azure IoT Suite Remote Monitoring preconfigured solution
Device information metadata in the remote monitoring preconfigured solution.
Device information metadata in the remote
monitoring preconfigured solution
11/6/2017 • 5 min to read • Edit Online
The Azure IoT Suite remote monitoring preconfigured solution demonstrates an approach for managing device
metadata. This article outlines the approach this solution takes to enable you to understand:
What device metadata the solution stores.
How the solution manages the device metadata.
Context
The remote monitoring preconfigured solution uses Azure IoT Hub to enable your devices to send data to the
cloud. The solution stores information about devices in three different locations:
Identity registry Device id, authentication keys, enabled Built in to IoT Hub
state
IoT Hub includes a device identity registry to manage access to an IoT hub and uses device twins to manage device
metadata. There is also a remote monitoring solution-specific device registry that stores command and method
history. The remote monitoring solution uses a Cosmos DB database to implement a custom store for command
and method history.
NOTE
The remote monitoring preconfigured solution keeps the device identity registry in sync with the information in the Cosmos
DB database. Both use the same device id to uniquely identify each device connected to your IoT hub.
Device metadata
IoT Hub maintains a device twin for each simulated and physical device connected to a remote monitoring
solution. The solution uses device twins to manage the metadata associated with devices. A device twin is a JSON
document maintained by IoT Hub, and the solution uses the IoT Hub API to interact with device twins.
A device twin stores three types of metadata:
Reported properties are sent to an IoT hub by a device. In the remote monitoring solution, simulated devices
send reported properties at start-up and in response to commands and methods. You
can view reported properties in the and in the solution portal. Reported properties
are read only.
Desired properties are retrieved from the IoT hub by devices. It is the responsibility of the device to make any
necessary configuration change on the device. It is also the responsibility of the device to report the change
back to the hub as a reported property. You can set a desired property value through the solution portal.
Tags only exist in the device twin and are never synchronized with a device. You can set tag values in the
solution portal and use them when you filter the list of devices. The solution also uses a tag to identify the icon
to display for a device in the solution portal.
Example reported properties from the simulated devices include manufacturer, model number, latitude, and
longitude. Simulated devices also return the list of supported methods as a reported property.
NOTE
The simulated device code only uses the and
desired properties to update the reported properties sent back to IoT Hub. All other
desired property change requests are ignored.
A device information metadata JSON document stored in the device registry Cosmos DB database has the
following structure:
NOTE
Device information can also include metadata to describe the telemetry the device sends to IoT Hub. The remote monitoring
solution uses this telemetry metadata to customize how the dashboard displays dynamic telemetry.
Lifecycle
When you first create a device in the solution portal, the solution creates an entry in the Cosmos DB database to
store command and method history. At this point, the solution also creates an entry for the device in the device
identity registry, which generates the keys the device uses to authenticate with IoT Hub. It also creates a device
twin.
When a device first connects to the solution, it sends reported properties and a device information message. The
reported property values are automatically saved in the device twin. The reported properties include the device
manufacturer, model number, serial number, and a list of supported methods. The device information message
includes the list of the commands the device supports including information about any command parameters.
When the solution receives this message, it updates the device information in the Cosmos DB database.
View and edit device information in the solution portal
The device list in the solution portal displays the following device properties as columns by default: ,
, , , , , , , and
. You can customize the columns by clicking . The device properties and
drive the location in the Bing Map on the dashboard.
In the pane in the solution portal, you can edit desired properties and tags (reported properties
are read only).
You can use the solution portal to remove a device from your solution. When you remove a device, the solution
removes the device entry from identity registry and then deletes the device twin. The solution also removes
information related to the device from the Cosmos DB database. Before you can remove a device, you must
disable it.
Device information message processing
Device information messages sent by a device are distinct from telemetry messages. Device information messages
include the commands a device can respond to, and any command history. IoT Hub itself has no knowledge of the
metadata contained in a device information message and processes the message in the same way it processes any
device-to-cloud message. In the remote monitoring solution, an Azure Stream Analytics (ASA) job reads the
messages from IoT Hub. The stream analytics job filters for messages that contain
and forwards them to the host instance that runs in a web job. Logic in the
instance uses the device ID to find the Cosmos DB record for the specific device and update
the record.
NOTE
A device information message is a standard device-to-cloud message. The solution distinguishes between device information
messages and telemetry messages by using ASA queries.
Next steps
Now you've finished learning how you can customize the preconfigured solutions, you can explore some of the
other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Frequently asked questions for IoT Suite
IoT security from the ground up
Predictive maintenance preconfigured solution
overview
11/14/2017 • 6 min to read • Edit Online
The predictive maintenance preconfigured solution is one of the Microsoft Azure IoT Suite preconfigured
solutions. This solution integrates real-time device telemetry collection with a predictive model created using
Azure Machine Learning.
With Azure IoT Suite, you can quickly and easily connect to and monitor assets, and analyze telemetry in real time
in dashboards and visualizations. In the predictive maintenance solution, the dashboards and visualizations
provide you with new intelligence that can drive efficiencies and enhance revenue streams.
The Scenario
Fabrikam is a regional airline that focuses on great customer experience at competitive prices. One cause of flight
delays is maintenance issues and aircraft engine maintenance is particularly challenging. Fabrikam must avoid
engine failure during flight at all costs, so it inspects its engines regularly and schedules maintenance according
to a plan. However, aircraft engines don’t always wear the same. Some unnecessary maintenance is performed
on engines. More importantly, issues arise which can ground an aircraft until maintenance is performed. If an
aircraft is at a location where the right technicians or spare parts are not available, these issues can be especially
costly.
The engines of Fabrikam’s aircraft are instrumented with sensors that monitor engine conditions during flight.
Fabrikam uses the predictive maintenance solution to collect the sensor data collected during the flight. After
accumulating years of engine operational and failure data, Fabrikam’s data scientists have modeled a way to
predict the Remaining Useful Life (RUL) of an aircraft engine. The model uses a correlation between data from
four of the engine sensors and engine wear that leads to eventual failure. While Fabrikam continues to perform
regular inspections to ensure safety, it can now use the models to compute the RUL for each engine after every
flight. The model uses the telemetry collected from the engines during the flight. Fabrikam can now predict future
points of failure and plan for maintenance and repair in advance.
NOTE
The solution model uses actual engine wear data.
By predicting the point when maintenance is required, Fabrikam can optimize its operations to reduce costs.
Maintenance coordinators work with schedulers to:
Plan maintenance to coincide with an aircraft stopping at a particular location.
Ensure sufficient time is available for the aircraft to be out of service without causing schedule disruption.
To schedule technicians to ensure that aircraft are serviced efficiently without wait time.
Inventory control managers receive maintenance plans, so they can optimize their ordering process and spare
parts inventory.
These activities enable Fabrikam to minimize aircraft ground time and reduce operating costs while ensuring the
safety of passengers and crew.
To understand how Azure IoT Suite provides the capabilities customers need to realize the potential of predictive
maintenance, review this infographic.
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
1. Log on to azureiotsuite.com using your Azure account credentials, and click to create a solution.
2. Click the tile.
3. Enter a for your predictive maintenance preconfigured solution.
4. Select the and you want to use to provision the solution.
5. Click to begin the provisioning process. This process typically takes several minutes to run.
Wait for the provisioning process to complete
1. Click the tile for your solution with status.
2. Notice the as Azure services are deployed in your Azure subscription.
3. Once provisioning completes, the status changes to .
4. Click the tile to see the details of your solution in the right-hand pane. From this pane, you can launch the
solution dashboard and access the Machine Learning workspace.
NOTE
If you encounter issues deploying the preconfigured solution, review Permissions on the azureiotsuite.com site and the
FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Make feature suggestions on User Voice.
When you provision the preconfigured solution, you receive an email with a link to the Machine Learning
workspace. You can also navigate to the Machine Learning workspace from the azureiotsuite.com page for your
provisioned solution. A tile is available on this page when the solution is in the state.
In the solution portal, you can see that the sample is provisioned with four simulated devices to represent two
aircraft with two engines per aircraft, each with four sensors. When you first navigate to the solution portal, the
simulation is stopped.
Click to begin the simulation. The sensor history, RUL, Cycles, and RUL history populate the
dashboard.
When RUL is less than 160 (an arbitrary threshold chosen for demonstration purposes), the solution portal
displays a warning symbol next to the RUL display. The solution portal also highlights the aircraft engine in
yellow. Notice how the RUL values have a general downward trend overall, but tend to bounce up and down. This
behavior results from the varying cycle lengths and the model accuracy.
The full simulation takes around 35 minutes to complete 148 cycles. The 160 RUL threshold is met for the first
time at around 5 minutes and both engines hit the threshold at around 8 minutes.
The simulation runs through the complete dataset for 148 cycles and settles on final RUL and cycle values.
You can stop the simulation at any point, but clicking replays the simulation from the start of
the dataset.
Next steps
To learn more about how Azure IoT enables predictive maintenance scenarios, read Capture value from the
Internet of Things.
Take a walkthrough of the predictive maintenance solution.
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Frequently asked questions for IoT Suite
IoT security from the ground up
Predictive maintenance preconfigured solution
walkthrough
11/14/2017 • 3 min to read • Edit Online
The predictive maintenance preconfigured solution is an end-to-end solution for a business scenario that predicts
the point at which a failure is likely to occur. You can use this preconfigured solution proactively for activities such
as optimizing maintenance. The solution combines key Azure IoT Suite services, such as IoT Hub, Stream analytics,
and an Azure Machine Learning workspace. This workspace contains a model, based on a public sample data set, to
predict the Remaining Useful Life (RUL) of an aircraft engine. The solution fully implements the IoT business
scenario as a starting point for you to plan and implement a solution that meets your own specific business
requirements.
Logical architecture
The following diagram outlines the logical components of the preconfigured solution:
The blue items are Azure services provisioned in the region where you deployed the preconfigured solution. The
list of regions where you can deploy the preconfigured solution displays on the provisioning page.
The green item is a simulated device that represents an aircraft engine. You can learn more about these simulated
devices in the Simulated devices section.
The gray items represent components that implement device management capabilities. The current release of the
predictive maintenance preconfigured solution does not provision these resources. To learn more about device
management, refer to the remote monitoring pre-configured solution.
Simulated devices
In the preconfigured solution, a simulated device represents an aircraft engine. The solution is provisioned with two
engines that map to a single aircraft. Each engine emits four types of telemetry: Sensor 9, Sensor 11, Sensor 14,
and Sensor 15 provide the data necessary for the Machine Learning model to calculate the RUL for the engine.
Each simulated device sends the following telemetry messages to IoT Hub:
Cycle count. A cycle represents a completed flight with a duration between two and ten hours. During the flight,
telemetry data is captured every half hour.
Telemetry. There are four sensors that represent engine attributes. The sensors are generically labeled Sensor 9,
Sensor 11, Sensor 14, and Sensor 15. These four sensors represent telemetry sufficient to obtain useful results
from the RUL model. The model used in the preconfigured solution is created from a public data set that includes
real engine sensor data. For more information on how the model was created from the original data set, see the
Cortana Intelligence Gallery Predictive Maintenance Template.
The simulated devices can handle the following commands sent from the IoT hub in the solution:
Event processor
The runs in an Azure Web Job. The takes the average sensor values for a
completed cycle. It then passes those values to an API that exposes trained model to calculate the RUL for an
engine. The API is exposed by a Machine Learning workspace that is provisioned as part of the solution.
Machine Learning
The Machine Learning component uses a model derived from data collected from real aircraft engines. You can
navigate to the Machine Learning workspace from your solution's tile on the azureiotsuite.com page. The tile is
available when the solution is in the state.
Next steps
Now you've seen the key components of the predictive maintenance preconfigured solution, you may want to
customize it. See Guidance on customizing preconfigured solutions.
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Frequently asked questions for IoT Suite
IoT security from the ground up
Get started with the Connected factory
preconfigured solution
12/12/2017 • 11 min to read • Edit Online
Azure IoT Suite preconfigured solutions combine multiple Azure IoT services to deliver end-to-end solutions that
implement common IoT business scenarios. The Connected factory preconfigured solution connects to and
monitors your industrial devices. You can use the solution to analyze the stream of data from your devices and to
drive operational productivity and profitability.
This tutorial shows you how to provision the Connected factory preconfigured solution. It also walks you through
the basic features of the preconfigured solution. You can access many of these features from the solution
dashboard that deploys as part of the preconfigured solution:
NOTE
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you encounter issues deploying the preconfigured solution, review Permissions on the azureiotsuite.com site and the
Connected factory FAQ. If the issues persist, create a service ticket on the portal.
Are there details you'd expect to see that aren't listed for your solution? Make feature suggestions on User Voice.
Scenario overview
When you deploy the Connected factory preconfigured solution, it is prepopulated with resources that enable you
to step through a common industrial scenario. In this scenario, several factories connected to the solution report
the data values required to compute overall equipment efficiency (OEE) and key performance indicators (KPIs).
The following sections show you how to:
Monitor factory, production lines, station OEE, and KPI values
Analyze the telemetry data generated from these devices using Azure Time Series Insights
Act on alarms to fix issues
A key feature of this scenario is that you can perform all these actions remotely from the solution dashboard. You
do not need physical access to the devices.
View factories
The Factory Locations panel shows you the geographical location of all the factories in the solution, their status,
and current production configuration. From the locations list, you can navigate to the other levels in the solution
hierarchy. The rows in the list are hyperlinks that link details of the production lines at that location. It is then
possible to drill into the production line details and down to the station level view. You can also apply a filter to
the list.
View map
If your subscription has access to the Bing Maps API, the Factories map shows you the geographical location and
status of all the factories in the solution. To drill into the location details, click the locations displayed on the map.
View alarms
The panel shows you alarms generated due to a reported value or a calculated OEE/KPI value exceeding
its configured threshold. This panel displays alarms at each level of the hierarchy, from the station level view to
the global view. The alarms contain a description of the alarm, date, time, location, and number of occurrences.
You can gain insights in to the data that caused the alarm using the Time Series Insights data. The Time Series
Insights data is visualized in the alarms where applicable. If you are an Administrator, you can take default actions
on the alarms such as:
Close the alarm.
Acknowledge the alarm.
Optionally, you can take more complex actions. For example, for the Pressure OPC UA Node of the Assembly you
could:
Show supporting information in a web page in a new browser window.
Mitigate the cause of the alarm by calling an OPC UA method on the device.
Suppress the availability of the default actions.
NOTE
These alarms are generated by rules that are specified in a configuration file in the preconfigured solution. These rules can
generate alarms when the OEE or KPI figures or OPC UA Node values are exceeding their configured threshold.
3. To further analyze the alarm data, click the graph in the alarm panel. This action opens the Time Series
Insights explorer environment.
View Key Performance Indicators
The solution provides two key performance indicators, units per hour and energy used in kWh.
1. To view units per hour or energy used for any level in the hierarchy, navigate to the specific view you
require. The units per hour and energy used display in the panel.
2. To analyze units per hour or energy used for any level in the hierarchy, click the gauge in the
panel. A context panel appears with Time Series Insights powered visualizations
enabling you to view data from the last hour, the last 24 hours, and last 7 days.
Scenario review
In this scenario, you monitored your factories OEE and KPIs values, in the dashboard. You then used Time Series
Insights to provide more information to help drill further into the telemetry data for OEE and KPIs to help with
detecting anomalies. You also used the alarm panel to view issues with your factories and you used the actions
available to you to resolve the alarm.
Other features
The following sections describe some additional features of the Connected factory solution that are not described
in the previous scenario.
Apply filters
1. Click the icon to display a list of available filters in either the factory locations panel or the alarms
panel.
2. The filters panel is displayed for you.
3. Choose the filter that you require. It is also possible to type free text into the filter fields.
4. The filter is then applied for you. The filter state is also shown in the dashboard via a funnel that displays in
the factories and alarms tables.
NOTE
An active filter does not affect the displayed OEE and KPI values, it only filters the list contents.
5. To clear a filter, click the funnel and click filter in the filter context panel. The text is displayed in the
factories and alarms tables.
Publish a node
When you browse a simulated OPC UA server, you can also choose to publish new nodes. You can analyze the
telemetry from these nodes in the solution. These simulated OPC UA servers make it easy to experiment with the
preconfigured solution without deploying real, physical devices.
1. Browse to a node in the OPC UA server browser tree that you wish to publish.
2. Right-click the node.
3. Choose .
4. A context panel appears which tells you that the publish has succeeded. The node appears in the station
level view with a check mark beside it.
5. A context panel appears informing you which method you are about to call and any parameter details is
applicable.
6. Choose .
7. The context panel is updated to inform you that the method call succeeded. You can verify the call
succeeded by reading the value of the pressure node that updated as a result of the call.
You can view the settings of each resource by selecting it in the list of resources in the resource group.
You can also view the source code for the preconfigured solution. The Connected factory preconfigured solution
source code is in the azure-iot-connected-factory GitHub repository:
When you are done, you can delete the preconfigured solution from your Azure subscription on the
azureiotsuite.com site. This site enables you to easily delete all the resources that were provisioned when you
created the preconfigured solution.
NOTE
To ensure that you delete everything related to the preconfigured solution, delete it on the azureiotsuite.com site. Do not
delete the resource group in the portal.
Next Steps
Now that you’ve deployed a working preconfigured solution, you can continue getting started with IoT Suite by
reading the following articles:
Connected factory preconfigured solution walkthrough
Connect your device to the Connected factory preconfigured solution
Permissions on the azureiotsuite.com site
Connected factory preconfigured solution
walkthrough
12/12/2017 • 8 min to read • Edit Online
The IoT Suite Connected factory preconfigured solution is an implementation of an end-to-end industrial solution
that:
Connects to both simulated industrial devices running OPC UA servers in simulated factory production lines,
and real OPC UA server devices. For more information about OPC UA, see the Connected factory FAQ.
Shows operational KPIs and OEE of those devices and production lines.
Demonstrates how a cloud-based application could be used to interact with OPC UA server systems.
Enables you to connect your own OPC UA server devices.
Enables you to browse and modify the OPC UA server data.
Integrates with the Azure Time Series Insights (TSI) service to provide customized views of the data from your
OPC UA servers.
You can use the solution as a starting point for your own implementation and customize it to meet your own
specific business requirements.
This article walks you through some of the key elements of the Connected factory solution to enable you to
understand how it works. The article also describes how data flows through the solution. This knowledge helps you
to:
Troubleshoot issues in the solution.
Plan how to customize to the solution to meet your own specific requirements.
Design your own IoT solution that uses Azure services.
For more information, see the Connected factory FAQ.
Logical architecture
The following diagram outlines the logical components of the preconfigured solution:
Communication patterns
The solution uses the OPC UA Pub/Sub specification to send OPC UA telemetry data to IoT Hub in JSON format.
The solution uses the OPC Publisher IoT Edge module for this purpose.
The solution also has an OPC UA client integrated into a web application that can establish connections with on-
premises OPC UA servers. The client uses a reverse-proxy and receives help from IoT Hub to make the connection
without requiring open ports in the on-premises firewall. This communication pattern is called service-assisted
communication. The solution uses the OPC Proxy IoT Edge module for this purpose.
Simulation
The simulated stations and the simulated manufacturing execution systems (MES) make up a factory production
line. The simulated devices and the OPC Publisher Module are based on the OPC UA .NET Standard published by
the OPC Foundation.
The OPC Proxy and OPC Publisher are implemented as modules based on Azure IoT Edge. Each simulated
production line has a designated gateway attached.
All simulation components run in Docker containers hosted in an Azure Linux VM. The simulation is configured to
run eight simulated production lines by default.
IoT Hub
The IoT hub receives data sent from the OPC Publisher Module into the cloud and makes it available to the Azure
TSI service.
The IoT Hub in the solution also:
Maintains an identity registry that stores the IDs for all OPC Publisher Module and all OPC Proxy Modules.
Is used as transport channel for bidirectional communication of the OPC Proxy Module.
Azure Storage
The solution uses Azure blob storage as disk storage for the VM and to store deployment data.
Web app
The web app deployed as part of the preconfigured solution comprises of an integrated OPC UA client, alerts
processing and telemetry visualization.
Flow steps
1. OPC Publisher reads the required OPC UA X509 certificates and IoT Hub security credentials from the local
certificate store.
If necessary, OPC Publisher creates and stores any missing certificates or credentials in the certificate
store.
2. OPC Publisher registers itself with IoT Hub.
Uses the configured protocol. Can use any IoT Hub client SDK supported protocol. The default is MQTT.
Protocol communication is secured by TLS.
3. OPC Publisher reads configuration file.
4. OPC Publisher creates an OPC Session with each configured OPC UA Server.
Uses TCP connection.
OPC Publisher and OPC UA Server authenticate each other using X509 certificates.
All further OPC UA traffic is encrypted by the configured OPC UA encryption mechanism.
OPC Publisher creates, in the OPC Session for each configured publishing interval, an OPC Subscription.
Creates OPC Monitored items for the OPC Nodes to publish in the OPC Subscription.
5. If a monitored OPC Node value changes, OPC UA Server sends updates to OPC Publisher.
6. OPC Publisher transcodes the new value.
Batches multiple changes if batching is enabled.
Creates an IoT Hub message.
7. OPC Publisher sends a message to IoT Hub.
Use the configured protocol.
Communication is secured by TLS.
8. Time Series Insights (TSI) reads the messages from IoT Hub.
Uses AMQP over TCP/TLS.
This step is internal to the datacenter.
9. Data at rest in TSI.
10. Connected factory WebApp in Azure AppService queries required data from TSI.
Uses TCP/TLS secured communication.
This step is internal to the datacenter.
11. Web browser connects to the Connected factory WebApp.
Renders the Connected factory dashboard.
Connects over HTTPS.
Access to the Connected factory App requires authentication of the user via Azure Active Directory.
Any WebApi calls into Connected factory app are secured by Anti-Forgery-Tokens.
12. On data updates, the Connected factory WebApp sends updated data to the web browser.
Uses the SignalR protocol.
Secured by TCP/TLS.
Flow steps
1. OPC Proxy (server component) starts up.
Reads the shared access keys from a local store.
If necessary, stores missing access keys in the store.
2. OPC Proxy (server component) registers itself with IoT Hub.
Reads all it's known devices from IoT Hub.
Uses MQTT over TLS over Socket or Secure Websocket.
3. Web browser connects to the Connected factory WebApp and renders the Connected factory dashboard.
Uses HTTPS.
A user selects an OPC UA server to connect to.
4. Connected factory WebApp establishes an OPC UA Session to the selected OPC UA server.
Uses OPC UA stack.
5. OPC Proxy transport receives a request from the OPC UA stack to establish a TCP socket connection to OPC
UA server.
It just retrieves the TCP payload and uses it unchanged.
This step is internal to the Connected factory WebApp.
6. OPC Proxy (client component) looks up OPC Proxy (server component) device in the IoT Hub device registry.
Then calls a device method of the OPC Proxy (server component) device in IoT Hub.
Uses HTTPS over TCP/TLS to look up OPC Proxy.
Uses using HTTPS over TCP/TLS to establish a TCP socket connection to the OPC UA server.
This step is internal to the datacenter.
7. IoT Hub calls a device method in the OPC Proxy (server component) device.
Uses an established MQTT over TLS over Socket or Secure Websocket connection to establish a TCP
socket connection to the OPC UA server.
8. OPC Proxy (server component) sends the TCP payload on to the shopfloor network.
9. The OPC UA server processes the payload and sends back the response.
10. The response is received by the socket of the OPC Proxy (server component).
OPC Proxy sends the data as return value of the device method to IoT Hub and the OPC Proxy (client
component).
This data is delivered to the OPC UA stack in the Connected factory app.
11. Connected factory WebApp returns OPC Browser UX enriched with the OPC UA-specific information it
received from the OPC UA server to the Web Browser to render it.
While browsing through the OPC address-space and applying functions to nodes in the OPC address-
space, the OPC Browser UX client part uses AJAX calls over HTTPS secured with Anti-Forgery Tokens to
get data from the Connected factory WebApp.
If necessary, the client uses the communication explained in steps 4 through to 10 to exchange
information with the OPC UA server.
NOTE
The OPC Proxy (server component) and OPC Proxy (client) component complete steps #4 through #10 for all TCP traffic
related to the OPC UA communication.
NOTE
For the OPC UA server and the OPC UA stack within the Connected factory WebApp, the OPC Proxy communication is
transparent and all OPC UA security features for authentication and encryption apply.
Next steps
You can continue getting started with IoT Suite by reading the following articles:
Permissions on the azureiotsuite.com site
Deploy a gateway on Windows or Linux for the Connected factory preconfigured solution
OPC Publisher reference implementation.
Deploy the Azure IoT Device Simulation solution
12/20/2017 • 1 min to read • Edit Online
This tutorial shows you how to provision a Device Simulation solution. You deploy the solution from
azureiotsuite.com.
In this tutorial, you learn how to:
Configure the Device Simulation solution
Deploy the Device Simulation solution
Sign in to the Device Simulation solution
Prerequisites
To complete this tutorial, you need an active Azure subscription.
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure
Free Trial.
2. You can view information about your Device Simulation solution in the panel that appears. Choose
to connect to your Device Simulation solution.
NOTE
You can delete your Device Simulation solution from this panel when you are finished with it.
Next steps
In this tutorial, you learned how to:
Configure the solution
Deploy the solution
Sign in to the solution
Now that you have deployed the Device Simulation solution, the next step is to explore the capabilities of the
Device Simulation solution.
Device Simulation walkthrough
12/20/2017 • 4 min to read • Edit Online
Azure IoT Device Simulation is a tool that can be used to assist in the development and testing of an IoT solution.
Device Simulation is a standalone offering that you can use in conjunction with other preconfigured solutions or
with your own custom solutions.
This tutorial walks you through some of the features of Device Simulation. It shows you how it works, and enables
you to use it to test your own IoT solutions.
In this tutorial, you learn how to:
Configure a simulation
Starting and stopping a simulation
View telemetry metrics
Prerequisites
To complete this tutorial, you need a deployed instance of Azure IoT Device Simulation in your Azure subscription.
If you haven't deployed Device Simulation yet, you should complete the Deploy Azure IoT Device Simulation
tutorial.
To target a specific IoT hub, provide the connection string. You can get this connection string from
the Azure portal:
1. On the IoT Hub configuration page in the Azure portal, click .
2. Click .
3. Copy either the primary or secondary key.
4. Paste this value into the text box under Target IoT Hub.
Device model
The device model enables you to choose the type of device to simulate. You can choose one of the pre-configured
device models or define a list of sensors for a custom device model:
Pre-Configured device models
Device Simulation provides three pre-configured device models. Device models for Chillers, Elevators, and Trucks
are available.
Pre-configured device models include multiple sensors with a pre-determined telemetry frequency. You cannot
customize the telemetry frequency for these devices.
The following table shows a list of the configurations for each pre-configured device model:
temperature F 5 seconds
Vibration mm 5 seconds
Temperature F 5 seconds
Truck Latitude 3 seconds
Longitude 3 seconds
cargotemperature F 5 seconds
Number of devices
Device Simulation currently enables you to simulate up to 1,000 devices.
Telemetry frequency
Telemetry frequency enables you to specify how often your simulated devices should send data to the IoT hub. You
can send data as frequently as every 10 seconds or as infrequently every as 99 hours, 59 minutes, and 59 seconds.
NOTE
If you are using an IoT hub other than the pre-provisioned IoT hub, then you should consider message limits for your target
IoT hub. For example, if you have 1,000 simulated devices sending telemetry every 10 seconds to an S1 hub you reach the
telemetry limit for the hub in just over an hour.
Simulation duration
You can choose to run your simulation for a specific length of time or to run until you explicitly stop it. When you
choose a specific length of time, you can choose any duration from 10 minutes up to 99 hours, 59 minutes, and 59
seconds.
Start and stop the simulation
When you have added all the necessary configuration data to the form, the button is enabled. To
start the simulation, click this button.
If you specified a specific duration for your simulation, then it stops automatically when the time has been reached.
You can always stop the simulation early by clicking
If you chose to run your simulation indefinitely, then it runs until you click . You can close your
browser and come back to the Device Simulation page to stop your simulation at any time.
NOTE
Only one simulation can be run at a time. You must stop the currently running simulation before you start a new simulation.
Perform advanced monitoring using the remote
monitoring solution
12/13/2017 • 2 min to read • Edit Online
This tutorial shows the capabilities of the remote monitoring dashboard. To introduce these capabilities, the
tutorial uses a scenario in the Contoso IoT application.
In this tutorial, you use two simulated Contoso truck devices to learn how to monitor your devices from the
preconfigured solution dashboard. As a Contoso operator, you need to monitor the location and behavior of your
trucks in the field.
In this tutorial, you learn how to:
Filter the devices in the dashboard
View real-time telemetry
View device details
View alarms from your devices
View the system KPIs
Prerequisites
To follow this tutorial, you need a deployed instance of the remote monitoring solution in your Azure subscription.
If you haven't deployed the remote monitoring solution yet, you should complete the Deploy the remote
monitoring preconfigured solution tutorial.
The filter also determines which devices you see in the chart:
To pause the live telemetry display, choose . To re-enable the live display, choose :
Use the map
The map displays information about the simulated trucks selected by the current filter. You can zoom and pan the
map to display locations in more or less detail. The device icons on the map indicate any or that
are active for the device. A summary of the number of and displays to the left of the map.
To view the device details, pan and zoom the map to locate the devices, then click the device on the map. The
details include:
Recent telemetry values
Methods the device supports
Device properties
You can use the filter to adjust the time span for recent alarms. By default, the panel displays
alarms from the last hour:
Next steps
This tutorial showed you how to use the page to filter and monitor the simulated trucks provisioned in
your remote monitoring solution:
Filter the devices in the dashboard
View real-time telemetry
View device details
View alarms from your devices
View the system KPIs
Now that you have learned how to monitor your devices, the suggested next steps are to learn how to:
Detect issues using threshold-based rules.
Manage and configure your devices.
Troubleshoot and remediate device issues.
Test your solution with simulated devices.
Detect issues using threshold-based rules
12/13/2017 • 2 min to read • Edit Online
This tutorial shows the capabilities of the rules engine in the remote monitoring solution. To introduce these
capabilities, the tutorial uses a scenario in the Contoso IoT application.
Contoso has a rule that generates a critical alert when the pressure reported by a device exceeds 250 PSI.
As an operator, you want to identify devices that may have problematic sensors by looking for initial
pressure spikes. To identify these devices, you create a rule to generate a warning when the pressure exceeds 150
PSI.
In this tutorial, you learn how to:
View the rules in your solution
Create a new rule
Edit an existing rule
Delete a rule
Prerequisites
To follow this tutorial, you need a deployed instance of the remote monitoring solution in your Azure subscription.
If you haven't deployed the remote monitoring solution yet, you should complete the Deploy the remote
monitoring preconfigured solution tutorial.
To disable, enable, or delete one or more rules, select multiple rules in the list:
Create a new rule
To add a new rule that generates a warning when the pressure in a device exceeds 150 PSI, choose
:
Disable a rule
To temporarily switch off a rule, you can disable it in the list of rules. Choose the rule to disable, and then choose
. The of the rule in the list changes to indicate the rule is now disabled. You can re-enable a rule
that you previously disabled using the same procedure.
You can enable and disable multiple rules at the same time if you select multiple rules in the list.
Delete a rule
To permanently delete a rule, choose the rule in the list of rules and then choose .
You can delete multiple rules at the same time if you select multiple rules in the list.
Next steps
This tutorial showed you how to:
View the rules in your solution
Create a new rule
Edit an existing rule
Delete a rule
Now that you have learned how to detect issues using threshold-based rules, the suggested next steps are to learn
how to:
Manage and configure your devices.
Troubleshoot and remediate device issues.
Test your solution with simulated devices.
Manage and configure your devices
12/13/2017 • 3 min to read • Edit Online
This tutorial shows the device management capabilities of the remote monitoring solution. To introduce these
capabilities, the tutorial uses a scenario in the Contoso IoT application.
Contoso has ordered new machinery to expand one of their facilities to increase output. While you wait for the
new machinery to be delivered, you want to run a simulation to verify the behavior of your solution. As an
operator, you want to manage and configure the devices in the remote monitoring solution.
To provide an extensible way to manage and configure devices, the remote monitoring solution uses IoT Hub
features such as jobs and direct methods. To learn how a device developer implements methods on a physical
device, see Customize the remote monitoring preconfigured solution.
In this tutorial, you learn how to:
Provision a simulated device.
Test the simulated device.
Call device methods from the solution.
Reconfigure a device.
Prerequisites
To follow this tutorial, you need a deployed instance of the remote monitoring solution in your Azure subscription.
If you haven't deployed the remote monitoring solution yet, you should complete the Deploy the remote
monitoring preconfigured solution tutorial.
To learn how to provision a physical device, see Connect your device to the remote monitoring preconfigured
solution.
In , verify your new device is sending telemetry. To view the different telemetry streams from your
device, choose a telemetry name such as :
The panel displays other information about the device such as tag values, the methods it supports,
and the properties reported by the device.
To view detailed diagnostics, scroll down to view .
Act on a device
To act on one or more devices, select them in the list of devices and then choose . The device
model specifies four methods a device must support:
Reconfigure a device
To change the configuration of a device, select it in the device list on the page and then choose
. The reconfigure panel shows the property values for the selected device that you can change:
To make a change, add a name for the job, update the property values, and choose :
Next steps
This tutorial showed you how to:
Provision a simulated device.
Test the simulated device.
Call device methods from the solution.
Reconfigure a device.
Now that you have learned how to manage your devices, the suggested next steps are to learn how to:
Troubleshoot and remediate device issues.
Test your solution with simulated devices.
Connect your device to the remote monitoring preconfigured solution.
Troubleshoot and remediate device issues
12/13/2017 • 2 min to read • Edit Online
This tutorial shows you how to use the page in the solution to troubleshoot and remediate device
issues. To introduce these capabilities, the tutorial uses a scenario in the Contoso IoT application.
Contoso is testing a new device in the field. As a Contoso operator, you notice during testing that the
device is unexpectedly triggering a temperature alarm on the dashboard. You must now investigate
the behavior of this faulty device.
In this tutorial, you learn how to:
Use the page to investigate the alarm
Call a device method to remediate the issue
Prerequisites
To follow this tutorial, you need a deployed instance of the remote monitoring solution in your Azure subscription.
If you haven't deployed the remote monitoring solution yet, you should complete the Deploy the remote
monitoring preconfigured solution tutorial.
To investigate the issue further, choose the option next to the alarm:
The detail view of the alarm shows:
When the alarm was triggered
Status information about the devices associated with the alarm
Telemetry from the devices associated with the alarm
To acknowledge the alarm, select the and choose . This action enables other
operators to see that you have seen the alarm and are working on it.
In the list, you can see the device responsible for firing the temperature alarm:
To track the status of the job on the page, choose . Use the view to track all the jobs and
method calls in the solution:
To view the details of a specific job or method call, choose it in the list in the view:
Next steps
In this tutorial, we showed you how to:
Use the page to investigate the alarm
Call a device method to remediate the issue
Now you have learned how to manage device issues, the suggested next step is to learn how to Test your solution
with simulated devices.
Test your solution with simulated devices
1/24/2018 • 16 min to read • Edit Online
This tutorial shows you how to customize the device simulator microservice in the remote monitoring
preconfigured solution. To show the capabilities of the device simulator, this tutorial uses two scenarios in the
Contoso IoT application.
In the first scenario, Contoso wants to test a new smart lightbulb device. To perform the tests, you create a new
simulated device with the following characteristics:
Properties
Brightness 0 to 100
Telemetry
The following table shows the data the lightbulb reports to the cloud as a data stream:
Temperature Degrees F
NOTE
The telemetry value is mandatory for all simulated types.
Methods
The following table shows the actions the new device supports:
Switch on
Switch off
Initial state
The following table shows the initial status of the device:
Initial color White
Initial brightness 75
In the second scenario, you add a new telemetry type to Contoso's existing device.
This tutorial shows you how to use the device simulator with the remote monitoring preconfigured solution:
In this tutorial, you learn how to:
Create a new device type
Simulate custom device behavior
Add a new device type to the dashboard
Send custom telemetry from an existing device type
Prerequisites
To follow this tutorial, you need:
A deployed instance of the remote monitoring solution in your Azure subscription. If you haven't deployed
the remote monitoring solution yet, you should complete the Deploy the remote monitoring preconfigured
solution tutorial.
Visual Studio 2017. If you don't have Visual Studio 2017 installed, you can download the free Visual Studio
Community edition.
Cloud Explorer for Visual Studio 2017 Visual Studio extension.
An account on Docker Hub. You can sign up for free to get started.
Git installed on your desktop machine.
3. To list the resources in your resource group, run the following command:
Make a note of the names of your virtual machine and your network security group. You use these values
in later steps.
4. To enable SSH access your virtual machine, run the following command using the name of your network
security group from the previous step:
To view the list of inbound rules for your network, run the following command:
5. To change the virtual machine password to a password you know, run the following command. Use the
name of the virtual machine you noted previously and a password of your choice:
6. To find the IP address of your virtual machine, use the following command and make a note of the public IP
address:
7. You can now use SSH to connect to your virtual machine. The command is pre-installed in the Cloud
Shell. Use the public IP address from the previous step and, when prompted, the password you configured
for the virtual machine:
You now have access to the shell in the virtual machine that runs the Docker containers in the remote
monitoring solution. To view the running containers, use the following command:
Find the service connection strings
In the tutorial, you work with Visual Studio solution that connects to the solution's Cosmos DB and IoT Hub
services. The following steps show you one way to find the connection string values you need:
1. To find the Cosmos DB connection string, run the following command in the SSH session connected to the
virtual machine:
Make a note of the connection string. You use this value later in the tutorial.
2. To find the IoT Hub connection string, run the following command in the SSH session connected to the
virtual machine:
Make a note of the connection string. You use this value later in the tutorial.
NOTE
You can also find these connection strings in the Azure portal or by using the command.
The device simulation service in the remote monitoring solution enables you to make changes to the built-
in simulated device types and to create new simulated device types. You can use custom device types to
test the behavior of the remote monitoring solution before you connect your physical devices.
3. To clone the .NET version of the repository, run the following command:
The device simulation service uses the storage adapter service to connect to the Cosmos DB service in
Azure. The remote monitoring solution stores the simulated device configuration data in a Cosmos DB
database.
Run the storage adapter service locally
The device simulation service uses the storage adapter service to connect to the solution's Cosmos DB database. If
you run the device simulation service locally, you must also run the storage adapter service locally. The following
steps show you how to run the storage adapter service from Visual Studio:
1. In Visual Studio, open the solution file in your local clone of the
repository.
2. In Solution Explorer, right-click the project, choose , and then choose .
3. In the section, edit the value of the
variable to be the Cosmos DB connection
string you noted previously. Then save your changes.
4. In Solution Explorer, right-click the project, choose , and then choose
.
5. The service starts running locally and opens in your default browser.
Verify that the value is "OK: Alive and well."
6. Leave the storage adapter service running locally until you have completed the tutorial.
You now have everything in place, and you are ready to start adding a new simulated device type to your remote
monitoring solution.
chiller-01.json lightbulb-01.json
scripts/chiller-01-state.js scripts/lightbulb-01-state.js
scripts/reboot-method.js scripts/SwitchOn-method.js
2. In the file, update the simulation definition as shown in the following snippet:
3. In the file, update the device type properties as shown in the following snippet:
4. In the file, update the device type telemetry definitions as shown in the following
snippet:
5. In the file, update the device type methods as shown in the following snippet:
3. Edit the function to implement the behavior as shown in the following snippet:
4. Save the file.
The file implements the method in a device. The following
steps update the file:
1. Edit the state definition in the file as shown in the following snippet:
5. To define a single chiller and a single lightbulb simulated device, replace the array with the
following code:
NOTE
You can also use the Cosmos DB Data Explorer in the Azure portal to edit the document.
5. In your browser, navigate to the for your remote monitoring solution. In the telemetry panel
on the , select . The temperature for your two simulated devices displays on the
chart:
You now have the lightbulb device simulation running locally. The next step is to deploy your updated simulator
code to the virtual machine that runs the remote monitoring microservices in Azure.
Before you continue, you can stop debugging both the device simulation and storage adapter projects in Visual
Studio.
Deploy the updated simulator to the cloud
The microservices in the remote monitoring solution run in docker containers. The containers are hosted in the
solution's virtual machine in Azure. In this section, you:
Create a new device simulation docker image.
Upload the image to your docker hub repository.
Import the image into your solution's virtual machine.
The following steps assume that you have a repository called in your Docker Hub account.
1. In Visual Studio, in the project, open the file .
2. Edit the line that sets the environment variable to your Docker Hub repository name:
8. To upload your new image to your Docker Hub account, run the following command:
9. To verify the upload, navigate to https://hub.docker.com/. Locate your repository and choose
. Then choose :
11. Edit the entry for the device simulation service to use your docker image:
You have now completed the steps to deploy an updated version of the device simulation service to your remote
monitoring solution.
In your browser, navigate to the for your remote monitoring solution. In the telemetry panel on the
, select . The temperature for your two simulated devices displays on the chart:
2. Each device type has a JSON model file and associated scripts in the folder. The files
that define the simulated device type are:
Next steps
This tutorial, showed you how to:
Create a new device type
Simulate custom device behavior
Add a new device type to the dashboard
Send custom telemetry from an existing device type
Now you have learned how to customize the device simulation service. The suggested next step is to learn how to
connect a physical device to your remote monitoring solution.
For more developer information about the remote monitoring solution, see:
Developer Reference Guide
Developer Troubleshooting Guide
Customize the remote monitoring preconfigured
solution
1/17/2018 • 6 min to read • Edit Online
This article provides information about how you can access the source code and customize the remote monitoring
preconfigured solution. The article describes:
The GitHub repositories that contain the source code and resources for the microservices that make up the
preconfigured solution.
Common customization scenarios such as adding a new device type.
The following video presents an overview of the options for customizing the remote monitoring preconfigured
solution:
Project overview
Implementations
The remote monitoring solution has both .NET and Java implementations. Both implementations provide similar
functionality and rely on the same underlying Azure services. You can find the top-level GitHub repositories here:
.NET solution
Java solution
Microservices
If you are interested in a specific feature of the solution, you can access the GitHub repositories for each individual
microservice. Each microservice implements a different part of the solution functionality. To learn more about the
overall architecture, see Remote monitoring preconfigured solution architecture.
This table summarizes the current availability of each microservice for each language:
The Java solution currently uses the .NET authentication, simulation, and reverse proxy microservices. These
microservices will be replaced by Java versions as soon as they become available.
Infrastructure
To modify the infrastructure in the remote monitoring solution, you can edit the code. The relevant GitHub
repositories are:
IoTHub Manager (.NET)
IoTHub Manager (Java)
Storage Adapter (.NET)
Storage Adapter (Java)
Next steps
In this article, you learned about the resources available to help you customize the preconfigured solution.
For more conceptual information about the remote monitoring preconfigured solution, see Remote monitoring
architecture
For more information about customizing the remote monitoring solution, see:
Developer Reference Guide
Developer Troubleshooting Guide
Deploy the remote monitoring preconfigured solution
using the CLI
12/13/2017 • 2 min to read • Edit Online
This tutorial shows you how to provision the remote monitoring preconfigured solution. You deploy the solution
using the CLI. You can also deploy the solution using the web-based UI at azureiotsuite.com, to learn about this
option see Deploy the remote monitoring preconfigured solution.
Prerequisites
To deploy the remote monitoring preconfigured solution, you need an active Azure subscription.
If you don’t have an account, you can create a free trial account in just a couple of minutes. For details, see Azure
Free Trial.
To run the CLI, you need Node.js installed on your local machine.
Deployment options
When you deploy the preconfigured solution, there are several options that configure the deployment process:
For more information about the CLI, see How to use the CLI.
Next steps
In this tutorial, you learned how to:
Configure the preconfigured solution
Deploy the preconfigured solution
Sign in to the preconfigured solution
Now that you have deployed the remote monitoring solution, the next step is to explore the capabilities of the
solution dashboard.
Connect your device to the remote monitoring
preconfigured solution (Windows)
12/13/2017 • 11 min to read • Edit Online
In this tutorial, you implement a device that sends the following telemetry to the remote monitoring
preconfigured solution:
Temperature
Pressure
Humidity
For simplicity, the code generates sample telemetry values for the . You could extend the sample by
connecting real sensors to your device and sending real telemetry.
The sample device also:
Sends metadata to the solution to describe its capabilities.
Responds to actions triggered from the page in the solution.
Responds to configuration changes send from the page in the solution.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free trial
account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need the device credentials when you
create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution page. You include the device credentials in your client
application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps on the page in the
solution:
1. Choose , and then choose as the :
3. Choose the you created on the page in the remote monitoring solution.
4. Make a note of the and values. You use these values when you add code to connect
your device to the solution.
You have now provisioned a physical device in the remote monitoring preconfigured solution. In the following
sections, you implement the client application that uses the device credentials to connect to your solution.
The client application implements the built-in device model. A preconfigured solution device model
specifies the following about a device:
The properties the device reports to the solution. For example, a device reports information about its
firmware and location.
The types of telemetry the device sends to the solution. For example, a device sends temperature,
humidity, and pressure values.
The methods you can schedule from the solution to run on the device. For example, a device must
implement , , , and methods.
This tutorial shows you how to connect a physical device to the remote monitoring preconfigured solution.
5. In Visual Studio, open the file. Replace the existing statements with the following
code:
NOTE
Now you can verify that your project has the correct dependencies set up by building the solution.
2. Add the following code to define the model that enables the device to communicate with IoT Hub. This
model specifies that the device:
Can send temperature, pressure, and humidity as telemetry.
Can send reported properties, to the device twin in IoT Hub. These reported properties include
information about the telemetry schema and supported methods.
Can receive and act on desired properties set in the device twin in IoT Hub.
Can respond to the , , , and
direct methods invoked from the UI. The device sends information about the direct methods it
supports using reported properties.
Implement the behavior of the device
Now add code that implements the behavior defined in the model.
1. Add the following functions that handle the desired properties set in the solution dashboard. These desired
properties are defined in the model:
2. Add the following functions that handle the direct methods invoked through the IoT hub. These direct
methods are defined in the model:
4. Add the following function that sends a message with properties to the preconfigured solution:
5. Add the following callback handler that runs when the device has sent new reported property values to the
preconfigured solution:
6. Add the following function to connect your device to the preconfigured solution in the cloud, and exchange
data. This function performs the following steps:
Initializes the platform.
Registers the Contoso namespace with the serialization library.
Initializes the client with the device connection string.
Create an instance of the model.
Creates and sends reported property values.
Creates a loop to send telemetry every five seconds.
Deinitializes all resources.
For reference, here is a sample message sent to the preconfigured solution:
Build and run the sample
Add code to invoke the function, then build and run the device application:
1. To invoke the function, replace the function with following code:
2. Choose and then to build the device application. Ignore the warning about the
function.
3. In , right-click the project, choose , and then choose
to run the sample. The console displays messages as:
The application sends sample telemetry to the preconfigured solution.
Receives desired property values set in the solution dashboard.
Responds to methods invoked from the solution dashboard.
5. A message displays in the console running your device code when the device handles the method.
NOTE
To track the status of the job in the solution, choose .
Next steps
The article Customize the remote monitoring preconfigured solution describes some ways to customize the
preconfigured solution.
Connect your device to the remote monitoring
preconfigured solution (Linux)
12/13/2017 • 11 min to read • Edit Online
In this tutorial, you implement a device that sends the following telemetry to the remote monitoring
preconfigured solution:
Temperature
Pressure
Humidity
For simplicity, the code generates sample telemetry values for the . You could extend the sample by
connecting real sensors to your device and sending real telemetry.
The sample device also:
Sends metadata to the solution to describe its capabilities.
Responds to actions triggered from the page in the solution.
Responds to configuration changes send from the page in the solution.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free trial
account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need the device credentials when you
create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution page. You include the device credentials in your
client application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps on the page in the
solution:
1. Choose , and then choose as the :
3. Choose the you created on the page in the remote monitoring solution.
4. Make a note of the and values. You use these values when you add code to connect
your device to the solution.
You have now provisioned a physical device in the remote monitoring preconfigured solution. In the following
sections, you implement the client application that uses the device credentials to connect to your solution.
The client application implements the built-in device model. A preconfigured solution device model
specifies the following about a device:
The properties the device reports to the solution. For example, a device reports information about its
firmware and location.
The types of telemetry the device sends to the solution. For example, a device sends temperature,
humidity, and pressure values.
The methods you can schedule from the solution to run on the device. For example, a device must
implement , , , and methods.
This tutorial shows you how to connect a physical device to the remote monitoring preconfigured solution.
2. Add the following code to define the model that enables the device to communicate with IoT Hub. This
model specifies that the device:
Can send temperature, pressure, and humidity as telemetry.
Can send reported properties, to the device twin in IoT Hub. These reported properties include
information about the telemetry schema and supported methods.
Can receive and act on desired properties set in the device twin in IoT Hub.
Can respond to the , , , and
direct methods invoked from the UI. The device sends information about the direct methods it
supports using reported properties.
Implement the behavior of the device
Now add code that implements the behavior defined in the model.
1. Add the following functions that handle the desired properties set in the solution dashboard. These desired
properties are defined in the model:
2. Add the following functions that handle the direct methods invoked through the IoT hub. These direct
methods are defined in the model:
4. Add the following function that sends a message with properties to the preconfigured solution:
5. Add the following callback handler that runs when the device has sent new reported property values to the
preconfigured solution:
6. Add the following function to connect your device to the preconfigured solution in the cloud, and exchange
data. This function performs the following steps:
Initializes the platform.
Registers the Contoso namespace with the serialization library.
Initializes the client with the device connection string.
Create an instance of the model.
Creates and sends reported property values.
Creates a loop to send telemetry every five seconds.
Deinitializes all resources.
For reference, here is a sample message sent to the preconfigured solution:
Add code to run the app
In a text editor, open the file. Add the following code:
3. To display a list of the methods you can call on your device, choose . To schedule a method to run
on multiple devices, you can select multiple devices in the list. The panel shows the types of
method common to all the devices you selected.
4. Choose , set the job name to , and choose :
5. A message displays in the console running your device code when the device handles the method.
NOTE
To track the status of the job in the solution, choose .
Next steps
The article Customize the remote monitoring preconfigured solution describes some ways to customize the
preconfigured solution.
Connect your device to the remote monitoring
preconfigured solution (Node.js)
12/13/2017 • 8 min to read • Edit Online
In this tutorial, you implement a device that sends the following telemetry to the remote monitoring
preconfigured solution:
Temperature
Pressure
Humidity
For simplicity, the code generates sample telemetry values for the . You could extend the sample by
connecting real sensors to your device and sending real telemetry.
The sample device also:
Sends metadata to the solution to describe its capabilities.
Responds to actions triggered from the page in the solution.
Responds to configuration changes send from the page in the solution.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free
trial account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need the device credentials when you
create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution page. You include the device credentials in your
client application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps on the page in the
solution:
1. Choose , and then choose as the :
3. Choose the you created on the page in the remote monitoring solution.
4. Make a note of the and values. You use these values when you add code to
connect your device to the solution.
You have now provisioned a physical device in the remote monitoring preconfigured solution. In the following
sections, you implement the client application that uses the device credentials to connect to your solution.
The client application implements the built-in device model. A preconfigured solution device model
specifies the following about a device:
The properties the device reports to the solution. For example, a device reports information about its
firmware and location.
The types of telemetry the device sends to the solution. For example, a device sends temperature,
humidity, and pressure values.
The methods you can schedule from the solution to run on the device. For example, a device must
implement , , , and methods.
This tutorial shows you how to connect a physical device to the remote monitoring preconfigured solution. In this
tutorial, you use Node.js, which is a good option for environments with minimal resource constraints.
3. In the folder, create a file called . Open this file in a text editor.
4. In the file, add the following statements:
5. Add the following variable declarations after the statements. Replace the placeholder values
and with values you noted for the device you provisioned in the remote
monitoring solution. Use the IoT Hub Hostname from the solution to replace . For example,
if your IoT Hub Hostname is , replace with :
10. Add the following helper function to use to randomize the telemetry values:
11. Add the following function to handle direct method calls from the solution. The solution uses direct
methods to act on devices:
12. Add the following code to send telemetry data to the solution. The client app adds properties to the
message to identify the message schema:
3. To display a list of the methods you can call on your device, choose . To schedule a method to
run on multiple devices, you can select multiple devices in the list. The panel shows the types of
method common to all the devices you selected.
4. Choose , set the job name to , and choose :
5. A message displays in the console running your device code when the device handles the method.
NOTE
To track the status of the job in the solution, choose .
Next steps
The article Customize the remote monitoring preconfigured solution describes some ways to customize the
preconfigured solution.
Connect your Raspberry Pi device to the remote
monitoring preconfigured solution (Node.js)
12/13/2017 • 9 min to read • Edit Online
In this tutorial, you implement a device that sends the following telemetry to the remote monitoring
preconfigured solution:
Temperature
Pressure
Humidity
For simplicity, the code generates sample telemetry values for the . You could extend the sample by
connecting real sensors to your device and sending real telemetry.
The sample device also:
Sends metadata to the solution to describe its capabilities.
Responds to actions triggered from the page in the solution.
Responds to configuration changes send from the page in the solution.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free trial
account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need the device credentials when you
create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution page. You include the device credentials in your
client application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps on the page in the
solution:
1. Choose , and then choose as the :
3. Choose the you created on the page in the remote monitoring solution.
4. Make a note of the and values. You use these values when you add code to
connect your device to the solution.
You have now provisioned a physical device in the remote monitoring preconfigured solution. In the following
sections, you implement the client application that uses the device credentials to connect to your solution.
The client application implements the built-in device model. A preconfigured solution device model
specifies the following about a device:
The properties the device reports to the solution. For example, a device reports information about its
firmware and location.
The types of telemetry the device sends to the solution. For example, a device sends temperature,
humidity, and pressure values.
The methods you can schedule from the solution to run on the device. For example, a device must
implement , , , and methods.
This tutorial shows you how to connect a physical device to the remote monitoring preconfigured solution. In this
tutorial, you use Node.js, which is a good option for environments with minimal resource constraints.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
Required desktop software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required Raspberry Pi software
If you haven't done so already, install Node.js version 4.0.0 or later on your Raspberry Pi. The following steps show
you how to install Node.js v6.11.4 on your Raspberry Pi:
1. Connect to your Raspberry Pi using . For more information, see SSH (Secure Shell) on the Raspberry Pi
website.
2. Use the following command to update your Raspberry Pi:
3. Use the following command to download the Node.js binaries to your Raspberry Pi:
5. Use the following command to verify you have installed Node.js v6.11.4 successfully:
Create a Node.js solution
Complete the following steps using the connection to your Raspberry Pi:
1. Create a folder called in your home folder on the Raspberry Pi. Navigate to this folder in
your command line:
2. To download and install the packages you need to complete the sample app, run the following commands:
3. In the folder, create a file called . Open this file in a text editor. On
the Raspberry Pi, you can use the or text editors.
4. In the file, add the following statements:
5. Add the following variable declarations after the statements. Replace the placeholder values
and with values you noted for the device you provisioned in the remote
monitoring solution. Use the IoT Hub Hostname from the solution to replace . For example, if
your IoT Hub Hostname is , replace with :
10. Add the following helper function to use to randomize the telemetry values:
11. Add the following function to handle direct method calls from the solution. The solution uses direct
methods to act on devices:
12. Add the following code to send telemetry data to the solution. The client app adds properties to the
message to identify the message schema:
3. To display a list of the methods you can call on your device, choose . To schedule a method to run
on multiple devices, you can select multiple devices in the list. The panel shows the types of
method common to all the devices you selected.
4. Choose , set the job name to , and choose :
5. A message displays in the console running your device code when the device handles the method.
NOTE
To track the status of the job in the solution, choose .
Next steps
The article Customize the remote monitoring preconfigured solution describes some ways to customize the
preconfigured solution.
Connect your Raspberry Pi device to the remote
monitoring preconfigured solution (C)
1/3/2018 • 12 min to read • Edit Online
In this tutorial, you implement a device that sends the following telemetry to the remote monitoring
preconfigured solution:
Temperature
Pressure
Humidity
For simplicity, the code generates sample telemetry values for the . You could extend the sample by
connecting real sensors to your device and sending real telemetry.
The sample device also:
Sends metadata to the solution to describe its capabilities.
Responds to actions triggered from the page in the solution.
Responds to configuration changes send from the page in the solution.
To complete this tutorial, you need an active Azure account. If you don't have an account, you can create a free trial
account in just a couple of minutes. For details, see Azure Free Trial.
NOTE
If you have already provisioned a device in your solution, you can skip this step. You need the device credentials when you
create the client application.
For a device to connect to the preconfigured solution, it must identify itself to IoT Hub using valid credentials. You
can retrieve the device credentials from the solution page. You include the device credentials in your
client application later in this tutorial.
To add a device to your remote monitoring solution, complete the following steps on the page in the
solution:
1. Choose , and then choose as the :
3. Choose the you created on the page in the remote monitoring solution.
4. Make a note of the and values. You use these values when you add code to
connect your device to the solution.
You have now provisioned a physical device in the remote monitoring preconfigured solution. In the following
sections, you implement the client application that uses the device credentials to connect to your solution.
The client application implements the built-in device model. A preconfigured solution device model
specifies the following about a device:
The properties the device reports to the solution. For example, a device reports information about its
firmware and location.
The types of telemetry the device sends to the solution. For example, a device sends temperature,
humidity, and pressure values.
The methods you can schedule from the solution to run on the device. For example, a device must
implement , , , and methods.
This tutorial shows you how to connect a physical device to the remote monitoring preconfigured solution. As with
most embedded applications that run on constrained devices, the client code for the Raspberry Pi device
application is written in C. In this tutorial, you build the application on a Raspberry Pi running the Raspbian OS.
Required hardware
A desktop computer to enable you to connect remotely to the command line on the Raspberry Pi.
Microsoft IoT Starter Kit for Raspberry Pi 3 or equivalent components. This tutorial uses the following items from
the kit:
Raspberry Pi 3
MicroSD Card (with NOOBS)
A USB Mini cable
An Ethernet cable
Required desktop software
You need SSH client on your desktop machine to enable you to remotely access the command line on the
Raspberry Pi.
Windows does not include an SSH client. We recommend using PuTTY.
Most Linux distributions and Mac OS include the command-line SSH utility. For more information, see SSH
Using Linux or Mac OS.
Required Raspberry Pi software
This article assumes you have installed the latest version of the Raspbian OS on your Raspberry Pi.
The following steps show you how to prepare your Raspberry Pi for building a C application that connects to the
preconfigured solution:
1. Connect to your Raspberry Pi using . For more information, see SSH (Secure Shell) on the Raspberry Pi
website.
2. Use the following command to update your Raspberry Pi:
3. Use the following command to add the required development tools and libraries to your Raspberry Pi:
4. Use the following commands to download, build, and install the IoT Hub client libraries on your Raspberry
Pi:
Create a project
Complete the following steps using the connection to your Raspberry Pi:
1. Create a folder called in your home folder on the Raspberry Pi. Navigate to this folder in
your shell:
2. Add the following code to define the model that enables the device to communicate with IoT Hub. This
model specifies that the device:
Can send temperature, pressure, and humidity as telemetry.
Can send reported properties, to the device twin in IoT Hub. These reported properties include
information about the telemetry schema and supported methods.
Can receive and act on desired properties set in the device twin in IoT Hub.
Can respond to the , , , and
direct methods invoked from the UI. The device sends information about the direct methods it
supports using reported properties.
4. Add the following function that sends a message with properties to the preconfigured solution:
5. Add the following callback handler that runs when the device has sent new reported property values to the
preconfigured solution:
6. Add the following function to connect your device to the preconfigured solution in the cloud, and exchange
data. This function performs the following steps:
Initializes the platform.
Registers the Contoso namespace with the serialization library.
Initializes the client with the device connection string.
Create an instance of the model.
Creates and sends reported property values.
Creates a loop to send telemetry every five seconds.
Deinitializes all resources.
For reference, here is a sample message sent to the preconfigured solution:
Save the file and exit the editor.
3. To display a list of the methods you can call on your device, choose . To schedule a method to run
on multiple devices, you can select multiple devices in the list. The panel shows the types of
method common to all the devices you selected.
4. Choose , set the job name to , and choose :
5. A message displays in the console running your device code when the device handles the method.
NOTE
To track the status of the job in the solution, choose .
Next steps
The article Customize the remote monitoring preconfigured solution describes some ways to customize the
preconfigured solution.
Remote monitoring preconfigured solution
architecture
11/10/2017 • 4 min to read • Edit Online
The IoT Suite remote monitoring preconfigured solution implements an end-to-end monitoring solution for
multiple machines in remote locations. The solution combines key Azure services to provide a generic
implementation of the business scenario. You can use the solution as a starting point for your own implementation
and customize it to meet your own specific business requirements.
This article walks you through some of the key elements of the remote monitoring solution to enable you to
understand how it works. This knowledge helps you to:
Troubleshoot issues in the solution.
Plan how to customize to the solution to meet your own specific requirements.
Design your own IoT solution that uses Azure services.
Logical architecture
The following diagram outlines the logical components of the remote monitoring preconfigured solution overlaid
on the IoT architecture:
Why microservices?
Cloud architecture has evolved since Microsoft released the first preconfigured solutions. Microservices have
emerged as a proven practice to achieve scale and flexibility without sacrificing development speed. Several
Microsoft services use this architectural pattern internally with great reliability and scalability results. The updated
preconfigured solutions put these learnings into practice so you can also benefit from them.
TIP
To learn more about microservice architectures, see .NET Application Architecture and Microservices: An application
revolution powered by the cloud.
Device connectivity
The solution includes the following components in the device connectivity part of the logical architecture:
Simulated devices
The solution includes a microservice that enables you to manage a pool of simulated devices to test the end-to-end
flow in the solution. The simulated devices:
Generate device-to-cloud telemetry.
Respond to cloud-to-device method calls from IoT Hub.
The microservice provides a RESTful endpoint for you to create, start, and stop simulations. Each simulation
consists of a set of virtual devices of different types, that send telemetry and respond to method calls.
You can provision simulated devices from the dashboard in the solution portal.
Physical devices
You can connect physical devices to the solution. You can implement the behavior of your simulated devices using
the Azure IoT device SDKs.
You can provision physical devices from the dashboard in the solution portal.
IoT Hub and the IoT manager microservice
The IoT hub ingests data sent from the devices into the cloud and makes it available to the
microservice.
The IoT hub in the solution also:
Maintains an identity registry that stores the IDs and authentication keys of all the devices permitted to connect
to the portal. You can enable and disable devices through the identity registry.
Invokes methods on your devices on behalf of the solution portal.
Maintains device twins for all registered devices. A device twin stores the property values reported by a device.
A device twin also stores desired properties, set in the solution portal, for the device to retrieve when it next
connects.
Schedules jobs to set properties for multiple devices or invoke methods on multiple devices.
The solution includes the microservice to handle interactions with your IoT hub such as:
Creating and managing IoT devices.
Managing device twins.
Invoking methods on devices.
Managing IoT credentials.
This service also runs IoT Hub queries to retrieve devices belonging to user-defined groups.
The microservice provides a RESTful endpoint to manage devices and device twins, invoke methods, and run IoT
Hub queries.
Data processing and analytics
The solution includes the following components in the data processing and analytics part of the logical
architecture:
Device telemetry
The solution includes two microservices to handle device telemetry.
The telemetry-agent microservice:
Stores telemetry in Cosmos DB.
Analyzes the telemetry stream from devices.
Generates alarms according to defined rules.
The alarms are stored in Cosmos DB.
The microservice enables the solution portal to read the telemetry sent from the devices. The
solution portal also uses this service to:
Define monitoring rules such as the thresholds that trigger alarms
Retrieve the list of past alarms.
Use the RESTful endpoint provided by this microservice to manage telemetry, rules, and alarms.
Storage
The storage-adapter microservice is an adapter in front of the main storage service used for the preconfigured
solution. It provides simple collection and key-value storage.
The standard deployment of the preconfigured solution uses Cosmos DB as its main storage service.
The Cosmos DB database stores data in the preconfigured solution. The microservice acts as an
adapter for the other microservices in the solution to access storage services.
Presentation
The solution includes the following components in the presentation part of the logical architecture:
The web user interface is a React Javascript application. The application:
Uses Javascript React only and runs entirely in the browser.
Is styled with CSS.
Interacts with public facing microservices through AJAX calls.
The user interface presents all the preconfigured solution functionality, and interacts with other services such as:
The authentication microservice to protect user data.
The iothub-manager microservice to list and manage the IoT devices.
The ui-config microservice enables the user interface to store and retrieve configuration settings.
Next steps
If you want to explore the source code and developer documentation, start with one the two main GitHub
repositories:
Preconfigured solution for remote monitoring with Azure IoT (.NET).
Preconfigured solution for remote monitoring with Azure IoT (Java).
Preconfigured solution for remote monitoring architecture).
For more conceptual information about the remote monitoring preconfigured solution, see Customize the
preconfigured solution.
Deploy an edge gateway for the Connected factory
preconfigured solution on Windows or Linux
1/17/2018 • 8 min to read • Edit Online
You need two software components to deploy an edge gateway for the Connected factory preconfigured solution:
The OPC Proxy establishes a connection to Connected factory. The OPC Proxy then waits for command and
control messages from the integrated OPC Browser that runs in the Connected factory solution portal.
The OPC Publisher connects to existing on-premises OPC UA servers and forwards telemetry messages
from them to Connected factory. You can connect an OPC classic device using the OPC classic adapter for
OPC UA.
Both components are open-source and are available as source on GitHub and as Docker containers on
DockerHub:
You do not need a public-facing IP address or open inbound ports in the gateway firewall for either component.
The OPC Proxy and OPC Publisher components only use outbound port 443.
The steps in this article show you how to deploy an edge gateway using Docker on either Windows or Linux. The
gateway enables connectivity to the Connected factory preconfigured solution. You can also use the components
without Connected factory.
NOTE
Both components can be used as modules in Azure IoT Edge.
If you are using Linux, no additional configuration is required to enable access to the file system.
On Windows, create a folder on the drive you shared with Docker, on Linux create a folder under the root
filesystem. This walkthrough refers to this folder as .
When you refer to the in a Docker command, be sure to use the correct syntax for your operating
system. Here are two examples, one for Windows and one for Linux:
If your are using the folder on Windows as your , the Docker command syntax
is .
If your are using the folder on Linux as your , the Docker command syntax is
.
For more information see the Use volumes docker engine reference.
To verify the bridge network was created, run the following command:
The OPC Publisher GitHub and the docker run reference provide more information about:
The docker command line options specified before the container name (
).
The meaning of the OPC Publisher command line parameters specified after the container name (
).
The is the shared access policy connection string from the
Azure portal. You copied this connection string in a previous step. You only need this connection string for
the first run of OPC Publisher. On subsequent runs you should omit it because it poses a security risk.
The you use and its syntax is described in the section Install and configure Docker. OPC
Publisher uses the to read and write to the OPC Publisher configuration file, write to the
log file, and make both these files available outside of the container.
OPC Publisher reads its configuration from the file, which is read from and written
to the folder. This configuration file defines which OPC UA node data on a given
OPC UA server the OPC Publisher should subscribe to. The full syntax of the file is
described on the OPC Publisher page on GitHub. When you add a gateway, put an empty
into the folder:
Whenever the OPC UA server notifies OPC Publisher of a data change, the new value is sent to IoT Hub.
Depending on the batching settings, the OPC Publisher may first accumulate the data before it sends the
data to IoT Hub in a batch.
Docker does not support NetBIOS name resolution, only DNS name resolution. If you don't have a DNS
server on the network, you can use the workaround shown in the previous command line example. The
previous command line example uses the parameter to add an entry into the containers hosts
file. This entry enables hostname lookup for the given , resolving to the given IP
address .
OPC UA uses X.509 certificates for authentication and encryption. You need to place the OPC Publisher
certificate on the OPC UA server you are connecting to, to ensure it trusts OPC Publisher. The OPC
Publisher certificate store is located in the folder. You can find the OPC
Publisher certificate in the folder in the folder.
The steps to configure the OPC UA server depend on the device you are using. these steps are typically
documented in the OPC UA server's user manual.
To install the OPC Proxy, run the following command at a command prompt:
OPC Proxy saves the connection string during the installation. On subsequent runs you should omit the
connection string because it poses a security risk.
2. Browse the OPC UA nodes tree of your OPC UA server, right-click the OPC nodes you want to send values
to Connected factory, and select .
3. Telemetry now flows from the gateway device. You can view the telemetry in the view
of the Connected factory portal under .
Next steps
To learn more about the architecture of the Connected factory preconfigured solution, see Connected factory
preconfigured solution walkthrough.
Learn about the OPC Publisher reference implementation.
Customize how the Connected factory solution
displays data from your OPC UA servers
12/14/2017 • 2 min to read • Edit Online
The Connected factory solution aggregates and displays data from the OPC UA servers connected to the solution.
You can browse and send commands to the OPC UA servers in your solution. For more information about OPC UA,
see the Connected factory FAQ.
Examples of aggregated data in the solution include the Overall Equipment Efficiency (OEE) and Key Performance
Indicators (KPIs) that you can view in the dashboard at the factory, line, and station levels. The following screenshot
shows the OEE and KPI values for the station, on , in the factory:
The solution enables you to view detailed information from specific data items from the OPC UA servers, called
stations. The following screenshot shows plots of the number of manufactured items from a specific station:
If you click one of the graphs, you can explore the data further using Time Series Insights (TSI):
This article describes:
How the data is made available to the various views in the solution.
How you can customize the way the solution displays the data.
Data sources
The Connected factory solution displays data from the OPC UA servers connected to the solution. The default
installation includes several OPC UA servers running a factory simulation. You can add your own OPC UA servers
that connect through a gateway to your solution.
You can browse the data items that a connected OPC UA server can send to your solution in the dashboard:
1. Choose to navigate to the view:
2. Select a server and click . Click when the security warning appears.
NOTE
This warning only appears once for each server and establishes a trust relationship between the solution dashboard
and the server.
3. You can now browse the data items that the server can send to the solution. Items that are being sent to the
solution have a check mark:
4. If you are an Administrator in the solution, you can choose to publish a data item to make it available in the
Connected factory solution. As an Administrator, you can also change the value of data items and call
methods in the OPC UA server.
Next Steps
Learn more about the Connected factory preconfigured solution by reading the following articles:
Connected factory preconfigured solution walkthrough
Deploy a gateway for Connected factory
Permissions on the azureiotsuite.com site
Connected factory FAQ
FAQ
OPC Publisher for Azure IoT Edge
11/14/2017 • 12 min to read • Edit Online
This article describes how to use the OPC Publisher reference implementation. The reference implementation
demonstrates how to use Azure IoT Edge to:
Connect to existing OPC UA servers.
Publish JSON encoded telemetry data from these servers in OPC UA Pub/Sub format, using a JSON payload, to
Azure IoT Hub. You can use any of the transport protocols that Azure IoT Edge supports.
This reference application includes:
An OPC UA client for connecting to existing OPC UA servers on your network.
An OPC UA server listening on port 62222 that you can use to manage what is published.
The application is implemented using .NET Core and can run on the platforms supported by .NET Core.
The publisher implements retry logic when it establishes connections to endpoints. The publisher expects
endpoints to respond within a specified number of keep alive requests. This retry logic enables the publisher to
detect conditions such as a power outage for an OPC UA server.
For each distinct publishing interval to an OPC UA server, it creates a separate subscription over which all nodes
with this publishing interval are updated.
To reduce network load, the publisher supports batching of data sent to IoT Hub. A batch is sent to IoT Hub only
when the configured package size is reached.
This application uses the OPC Foundations's OPC UA reference stack and therefore licensing restrictions apply.
Visit http://opcfoundation.github.io/UA-.NETStandardLibrary/ for OPC UA documentation and licensing terms.
You can find the OPC Publisher source code in the OPC Publisher for Azure IoT Edge GitHub repository.
Prerequisites
To build the application, you need the .NET Core SDK 1.1. for your operating system.
The option for is optional and the default is to use the configuration file.
Docker also enables you to build directly from a git repository. You can build a Linux Docker container with the
following command:
Configure the OPC UA nodes to publish
To configure which OPC UA nodes should have their values published to Azure IoT Hub, create a JSON formatted
configuration file. The default name for this configuration file is . The application updates and
saves this configuration file when it uses the OPC UA server methods or .
The syntax of the configuration file is as follows:
Run the application
Command-line options
To see the complete usage of the application, use the command-line option. The following example shows
the structure of a command:
is the OPC UA application name to use. This parameter is required. The application name is also
used to register the publisher in the IoT Hub device registry.
is the IoT Hub owner connection string. This parameter is optional.
The following options are supported:
You can use the following environment variables to control the application:
: sets the IoT Hub owner connection string
: sets the filename of the log file to use
: sets the path to store certificates of trusted stations
: sets the filename of the publishing configuration file
The container can now be reached by other containers over the network using the name .
Assign a hostname
Publisher uses the hostname of the machine it is running on for certificate and endpoint generation. Docker
chooses a random hostname unless you set one with the option. Here an example to set the internal hostname
of the container to :
Now you can start debugging using the following command in Visual Studio's Command Window:
Next steps
A suggested next step is to learn how to Deploy a gateway on Windows or Linux for the connected factory
preconfigured solution.
Configure the Connected factory preconfigured
solution
1/2/2018 • 9 min to read • Edit Online
The Connected factory preconfigured solution shows a simulated dashboard for a fictional company Contoso. This
company has factories in numerous global locations globally.
This article uses Contoso as an example to describe how to configure the topology of a Connected factory solution.
Identifies (globally unique) the OPC UA server the telemetry comes from. In the ingested messages, this
property is sent as .
Identifies the node value in the OPC UA server. The format of the property must be as specified in the OPC
UA specification. In the ingested messages, this property is sent as .
Check this GitHub page for more information on how the telemetry data is ingested to Connected factory using the
OPC Publisher.
This configuration enables querying of the telemetry values of this node using Time Series Insights. The Time
Series Insights query retrieves:
The number of values.
The minimal value.
The maximal value.
The average of all values.
The sum of all values for all unique ( ), pairs in a given timespan.
One characteristic of the node value is that it only increases. To calculate
the number of products manufactured in the timespan, Connected factory uses the . The
calculation retrieves the minimum value at the start of the timespan and the maximum value at the end of the
timespan.
The in the configuration configures the computation logic to calculate the result of the difference of
maximum and minimum value. Those results are then accumulated bottom up to the root (global) level and shown
in the dashboard.
Next steps
A suggested next step is to learn how to Deploy a gateway on Windows or Linux for the connected factory
preconfigured solution.
Permissions on the azureiotsuite.com site
12/18/2017 • 3 min to read • Edit Online
AAD roles
The AAD roles control the ability provision preconfigured solutions and manage users in a preconfigured solution.
You can find more information about administrator roles in AAD in Assigning administrator roles in Azure AD. The
current article focuses on the and the directory roles as used by the preconfigured
solutions.
Global administrator
There can be many global administrators per AAD tenant:
When you create an AAD tenant, you are by default the global administrator of that tenant.
The global administrator can provision a basic and standard preconfigured solutions.
Domain user
There can be many domain users per AAD tenant:
A domain user can provision a basic preconfigured solution through the azureiotsuite.com site.
A domain user can create a basic preconfigured solution using the CLI.
Guest User
There can be many guest users per AAD tenant. Guest users have a limited set of rights in the AAD tenant. As a
result, guest users cannot provision a preconfigured solution in the AAD tenant.
For more information about users and roles in AAD, see the following resources:
Create users in Azure AD
Assign users to apps
FAQ
I'm a service administrator and I'd like to change the directory mapping between my subscription and a specific
AAD tenant. How do I complete this task?
See To add an existing subscription to your Azure AD directory
I want to change a Service Administrator or Co-Administrator when logged in with an organisational account
See the support article Changing Service Administrator and Co-Administrator when logged in with an
organisational account.
Why am I seeing this error? "Your account does not have the proper permissions to create a solution. Please
check with your account administrator or try with a different account."
Look at the following diagram for guidance:
NOTE
If you continue to see the error after validating you are a global administrator on the AAD tenant and a co-administrator on
the subscription, have your account administrator remove the user and reassign necessary permissions in this order. First,
add the user as a global administrator and then add user as a co-administrator on the Azure subscription. If issues persist,
contact Help & Support.
Why am I seeing this error when I have an Azure subscription? "An Azure subscription is required to create pre-
configured solutions. You can create a free trial account in just a couple of minutes."
If you're certain you have an Azure subscription, validate the tenant mapping for your subscription and ensure the
correct tenant is selected in the dropdown. If you’ve validated the desired tenant is correct, follow the preceding
diagram and validate the mapping of your subscription and this AAD tenant.
Next steps
To continue learning about IoT Suite, see how you can customize a preconfigured solution.
Internet of Things security architecture
1/17/2018 • 24 min to read • Edit Online
When designing a system, it is important to understand the potential threats to that system, and add appropriate
defenses accordingly, as the system is designed and architected. It is important to design the product from the start
with security in mind because understanding how an attacker might be able to compromise a system helps make
sure appropriate mitigations are in place from the beginning.
Security in IoT
Connected special-purpose devices have a significant number of potential interaction surface areas and interaction
patterns, all of which must be considered to provide a framework for securing digital access to those devices. The
term “digital access” is used here to distinguish from any operations that are carried out through direct device
interaction where access security is provided through physical access control. For example, putting the device into a
room with a lock on the door. While physical access cannot be denied using software and hardware, measures can
be taken to prevent physical access from leading to system interference.
As you explore the interaction patterns, look at “device control” and “device data” with the same level of attention.
“Device control” can be classified as any information that is provided to a device by any party with the goal of
changing or influencing its behavior towards its state or the state of its environment. “Device data” can be classified
as any information that a device emits to any other party about its state and the observed state of its environment.
In order to optimize security best practices, it is recommended that a typical IoT architecture is divided into several
component/zones as part of the threat modeling exercise. These zones are described fully throughout this section
and include:
Device,
Field Gateway,
Cloud gateways, and
Services.
Zones are broad way to segment a solution; each zone often has its own data and authentication and authorization
requirements. Zones can also be used to isolation damage and restrict the impact of low trust zones on higher trust
zones.
Each zone is separated by a Trust Boundary, which is noted as the dotted red line in the following diagram. It
represents a transition of data/information from one source to another. During this transition, the data/information
could be subject to Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service and Elevation of
Privilege (STRIDE).
The components depicted within each boundary are also subjected to STRIDE, enabling a full 360 threat modeling
view of the solution. The following sections elaborate on each of the components and specific security concerns
and solutions that should be put into place.
The following sections discuss standard components typically found in these zones.
The Device Zone
The device environment is the immediate physical space around the device where physical access and/or “local
network” peer-to-peer digital access to the device is feasible. A “local network” is assumed to be a network that is
distinct and insulated from – but potentially bridged to – the public Internet, and includes any short-range wireless
radio technology that permits peer-to-peer communication of devices. It does not include any network
virtualization technology creating the illusion of such a local network and it does also not include public operator
networks that require any two devices to communicate across public network space if they were to enter a peer-to-
peer communication relationship.
The Field Gateway Zone
Field gateway is a device/appliance or some general-purpose server computer software that acts as
communication enabler and, potentially, as a device control system and device data processing hub. The field
gateway zone includes the field gateway itself and all devices that are attached to it. As the name implies, field
gateways act outside dedicated data processing facilities, are usually location bound, are potentially subject to
physical intrusion, and has limited operational redundancy. All to say that a field gateway is commonly a thing one
can touch and sabotage while knowing what its function is.
A field gateway is different from a mere traffic router in that it has had an active role in managing access and
information flow, meaning it is an application addressed entity and network connection or session terminal. An
NAT device or firewall, in contrast, does not qualify as field gateways since they are not explicit connection or
session terminals, but rather a route (or block) connections or sessions made through them. The field gateway has
two distinct surface areas. One faces the devices that are attached to it and represents the inside of the zone, and
the other faces all external parties and is the edge of the zone.
The cloud gateway zone
Cloud gateway is a system that enables remote communication from and to devices or field gateways from several
different sites across public network space, typically towards a cloud-based control and data analysis system, a
federation of such systems. In some cases, a cloud gateway may immediately facilitate access to special-purpose
devices from terminals such as tablets or phones. In the context discussed here, “cloud” is meant to refer to a
dedicated data processing system that is not bound to the same site as the attached devices or field gateways. Also
in a Cloud Zone, operational measures prevent targeted physical access and are not necessarily exposed to a
“public cloud” infrastructure.
A cloud gateway may potentially be mapped into a network virtualization overlay to insulate the cloud gateway
and all of its attached devices or field gateways from any other network traffic. The cloud gateway itself is not a
device control system or a processing or storage facility for device data; those facilities interface with the cloud
gateway. The cloud gateway zone includes the cloud gateway itself along with all field gateways and devices
directly or indirectly attached to it. The edge of the zone is a distinct surface area where all external parties
communicate through.
The services zone
A “service” is defined for this context as any software component or module that is interfacing with devices
through a field- or cloud gateway for data collection and analysis, as well as for command and control. Services are
mediators. They act under their identity towards gateways and other subsystems, store and analyze data,
autonomously issue commands to devices based on data insights or schedules and expose information and control
capabilities to authorized end users.
Information-devices versus special-purpose devices
PCs, phones, and tablets are primarily interactive information devices. Phones and tablets are explicitly optimized
around maximizing battery lifetime. They preferably turn off partially when not immediately interacting with a
person, or when not providing services like playing music or guiding their owner to a particular location. From a
systems perspective, these information technology devices are mainly acting as proxies towards people. They are
“people actuators” suggesting actions and “people sensors” collecting input.
Special-purpose devices, from simple temperature sensors to complex factory production lines with thousands of
components inside them, are different. These devices are much more scoped in purpose and even if they provide
some user interface, they are largely scoped to interfacing with or be integrated into assets in the physical world.
They measure and report environmental circumstances, turn valves, control servos, sound alarms, switch lights,
and do many other tasks. They help to do work for which an information device is either too generic, too expensive,
too large, or too brittle. The concrete purpose immediately dictates their technical design as well the available
monetary budget for their production and scheduled lifetime operation. The combination of these two key factors
constrains the available operational energy budget, physical footprint, and thus available storage, compute, and
security capabilities.
If something “goes wrong” with automated or remote controllable devices, for example, physical defects or control
logic defects to willful unauthorized intrusion and manipulation. The production lots may be destroyed, buildings
may be looted or burned down, and people may be injured or even die. This is a whole different class of damage
than someone maxing out a stolen credit card's limit. The security bar for devices that make things move, and also
for sensor data that eventually results in commands that cause things to move, must be higher than in any e-
commerce or banking scenario.
Device control and device data interactions
Connected special-purpose devices have a significant number of potential interaction surface areas and interaction
patterns, all of which must be considered to provide a framework for securing digital access to those devices. The
term “digital access” is used here to distinguish from any operations that are carried out through direct device
interaction where access security is provided through physical access control. For example, putting the device into a
room with a lock on the door. While physical access cannot be denied using software and hardware, measures can
be taken to prevent physical access from leading to system interference.
As you explore the interaction patterns, look at “device control” and “device data” with the same level of attention
while threat modeling. “Device control” can be classified as any information that is provided to a device by any
party with the goal of changing or influencing its behavior towards its state or the state of its environment. “Device
data” can be classified as any information that a device emits to any other party about its state and the observed
state of its environment.
The following diagram provides a simplified view of Microsoft’s IoT Architecture using a Data Flow Diagram model
that is used by the Microsoft Threat Modeling Tool:
It is important to note that the architecture separates the device and gateway capabilities. This approach enables
the user to leverage gateway devices that are more secure: they are capable of communicating with the cloud
gateway using secure protocols, which typically requires greater processing overhead that a native device - such as
a thermostat - could provide on its own. In the Azure services zone, assume that the Cloud Gateway is represented
by the Azure IoT Hub service.
Device and data sources/data transport
This section explores the architecture outlined previously through the lens of threat modeling and gives an
overview of how to address some of the inherent concerns. This example focuses on the core elements of a threat
model:
Processes (both under your control and external items)
Communication (also called data flows)
Storage (also called data stores)
Processes
In each of the categories outlined in the Azure IoT architecture, this example tries to mitigate a number of different
threats across the different stages data/information exists in: process, communication, and storage. Following is an
overview of the most common ones for the “process” category, followed by an overview of how these threats could
be best mitigated:
: An attacker may extract cryptographic key material from a device, either at the software or hardware
level, and subsequently access the system with a different physical or virtual device under the identity of the device
the key material has been taken from. A good illustration is remote controls that can turn any TV and that are
popular prankster tools.
: A device can be rendered incapable of functioning or communicating by interfering with
radio frequencies or cutting wires. For example, a surveillance camera that had its power or network connection
intentionally knocked out cannot report data, at all.
: An attacker may partially or wholly replace the software running on the device, potentially
allowing the replaced software to leverage the genuine identity of the device if the key material or the
cryptographic facilities holding key materials were available to the illicit program. For example, an attacker may
leverage extracted key material to intercept and suppress data from the device on the communication path and
replace it with false data that is authenticated with the stolen key material.
: If the device is running manipulated software, such manipulated software could
potentially leak data to unauthorized parties. For example, an attacker may leverage extracted key material to inject
itself into the communication path between the device and a controller or field gateway or cloud gateway to siphon
off information.
: A device that does specific function can be forced to do something else. For example, a
valve that is programmed to open half way can be tricked to open all the way.
Device S Assigning identity to Replacing device or Authenticating the
the device and part of the device device, using
authenticating the with some other Transport Layer
device device. How do you Security (TLS) or
know you are talking IPSec. Infrastructure
to the right device? should support using
pre-shared key (PSK)
on those devices that
cannot handle full
asymmetric
cryptography.
Leverage Azure AD,
OAuth
Field Gateway S Authenticating the If someone can spoof TLS RSA/PSK, IPSec,
Field gateway to Field Gateway, then it RFC 4279. All the
Cloud Gateway (such can present itself as same key storage and
as cert based, PSK, or any device. attestation concerns
Claim based.) of devices in general –
best case is use TPM.
6LowPAN extension
for IPSec to support
Wireless Sensor
Networks (WSN).
TRID Protect the Field Spoofing attacks that Memory encryption,
Gateway against trick the cloud TPM’s, authentication.
tampering (TPM?) gateway thinking it is
talking to field
gateway could result
in information
disclosure and data
tampering
E Access control
mechanism for Field
Gateway
External Entity Device TID Strong pairing of the Eavesdropping the Securely pairing the
external entity to the connection to the external entity to the
device device. Interfering the device NFC/Bluetooth
communication with LE. Controlling the
the device operational panel of
the device (Physical)
Device storage TRID Storage encryption, Reading data from Encryption, message
signing the logs the storage (PII data), authentication code
tampering with (MAC), or digital
telemetry data. signature. Where
Tampering with possible, strong
queued or cached access control
command control through resource
data. Tampering with access control lists
configuration or (ACLs) or permissions.
firmware update
packages while
cached or queued
locally can lead to OS
and/or system
components being
compromised
Additional resources
For more information, see the following articles:
SDL Threat Modeling Tool
Microsoft Azure IoT reference architecture
See also
To learn more about securing your IoT solution, see Secure your IoT deployment.
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Frequently asked questions for IoT Suite
You can read about IoT Hub security in Control access to IoT Hub in the IoT Hub developer guide.
Internet of Things security best practices
1/17/2018 • 6 min to read • Edit Online
Securing an Internet of Things (IoT) infrastructure requires a rigorous security-in-depth strategy. This strategy
requires you to secure data in the cloud, protect data integrity while in transit over the public internet, and securely
provision devices. Each layer builds greater security assurance in the overall infrastructure.
See also
To learn more about securing your IoT solution, see:
IoT security architecture
Secure your IoT deployment
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Frequently asked questions for Azure IoT Suite
You can read about IoT Hub security in Control access to IoT Hub in the IoT Hub developer guide.
Secure your IoT deployment
1/17/2018 • 7 min to read • Edit Online
This article provides the next level of detail for securing the Azure IoT-based Internet of Things (IoT) infrastructure.
It links to implementation level details for configuring and deploying each component. It also provides
comparisons and choices between various competing methods.
Securing the Azure IoT deployment can be divided into the following three security areas:
: Securing the IoT device while it is deployed in the wild.
: Ensuring all data transmitted between the IoT device and IoT Hub is confidential and
tamper-proof.
: Providing a means to secure data while it moves through, and is stored in the cloud.
Conclusion
This article provides overview of implementation level details for designing and deploying an IoT infrastructure
using Azure IoT. Configuring each component to be secure is key in securing the overall IoT infrastructure. The
design choices available in Azure IoT provide some level of flexibility and choice; however, each choice may have
security implications. It is recommended that each of these choices be evaluated through a risk/cost assessment.
See also
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Frequently asked questions for IoT Suite
You can read about IoT Hub security in Control access to IoT Hub in the IoT Hub developer guide.
Internet of Things security from the ground up
1/17/2018 • 12 min to read • Edit Online
The Internet of Things (IoT) poses unique security, privacy, and compliance challenges to businesses worldwide.
Unlike traditional cyber technology where these issues revolve around software and how it is implemented, IoT
concerns what happens when the cyber and the physical worlds converge. Protecting IoT solutions requires
ensuring secure provisioning of devices, secure connectivity between these devices and the cloud, and secure data
protection in the cloud during processing and storage. Working against such functionality, however, are resource-
constrained devices, geographic distribution of deployments, and a large number of devices within a solution.
This article explores how the Microsoft Azure IoT Suite provides a secure and private Internet of Things cloud
solution. The Azure IoT Suite delivers a complete end-to-end solution, with security built into every stage from the
ground up. At Microsoft, developing secure software is part of the software engineering practice, rooted in
Microsoft's decades long experience of developing secure software. To ensure this, Security Development
Lifecycle (SDL) is the foundational development methodology, coupled with a host of infrastructure-level security
services such as Operational Security Assurance (OSA) and the Microsoft Digital Crimes Unit, Microsoft Security
Response Center, and Microsoft Malware Protection Center.
The Azure IoT Suite offers unique features that make provisioning, connecting to, and storing data from IoT
devices easy and transparent and, most of all, secure. This article examines the Azure IoT Suite security features
and deployment strategies to ensure security, privacy, and compliance challenges are addressed.
Introduction
The Internet of Things (IoT) is the wave of the future, offering businesses immediate and real-world opportunities
to reduce costs, increase revenue, and transform their business. Many businesses, however, are hesitant to deploy
IoT in their organizations due to concerns about security, privacy, and compliance. A major point of concern
comes from the uniqueness of the IoT infrastructure, which merges the cyber and physical worlds together,
compounding individual risks inherent in these two worlds. Security of IoT pertains to ensuring the integrity of
code running on devices, providing device and user authentication, defining clear ownership of devices (as well as
data generated by those devices), and being resilient to cyber and physical attacks.
Then, there’s the issue of privacy. Companies want transparency concerning data collection, as in what’s being
collected and why, who can see it, who controls access, and so on. Finally, there are general safety issues of the
equipment along with the people operating them, and issues of maintaining industry standards of compliance.
Given the security, privacy, transparency, and compliance concerns, choosing the right IoT solution provider
remains a challenge. Stitching together individual pieces of IoT software and services provided by a variety of
vendors introduces gaps in security, privacy, transparency, and compliance, which may be hard to detect, let alone
fix. The choice of the right IoT software and service provider is based on finding providers that have extensive
experience running services, which span across verticals and geographies, but are also able to scale in a secure
and transparent fashion. Similarly, it helps for the selected provider to have decades of experience with
developing secure software running on billions of machines worldwide, and have the ability to appreciate the
threat landscape posed by this new world of the Internet of Things.
Conclusion
The Internet of Things starts with your things—the things that matter most to businesses. IoT can deliver amazing
value to a business by reducing costs, increasing revenue, and transforming business. Success of this
transformation largely depends on choosing the right IoT software and service provider. That means finding a
provider that not only catalyzes this transformation by understanding business needs and requirements, but also
provides services and software built with security, privacy, transparency, and compliance as major design
considerations. Microsoft has extensive experience with developing and deploying secure software and services
and continues to be a leader in this new age of Internet of Things.
The Microsoft Azure IoT Suite builds in security measures by design, enabling secure monitoring of assets to
improve efficiencies, drive operational performance to enable innovation, and employ advanced data analytics to
transform businesses. With its layered approach towards security, multiple security features, and design patterns,
Azure IoT Suite helps deploy an infrastructure that can be trusted to transform any business.
Additional information
Each Azure IoT Suite pre-configured solution creates instances of Azure services, such as:
: Your gateway that connects the cloud to devices. You can scale to millions of connections per
hub and process massive volumes of data with per-device authentication support helping you secure your
solution.
: A scalable, fully-indexed database service for semi-structured data that manages metadata
for the devices you provision, such as attributes, configuration, and security properties. Azure Cosmos DB
offers high-performance and high-throughput processing, schema-agnostic indexing of data, and a rich SQL
query interface.
: Real-time stream processing in the cloud that enables you to rapidly develop and
deploy a low-cost analytics solution to uncover real-time insights from devices, sensors, infrastructure, and
applications. The data from this fully-managed service can scale to any volume while still achieving high
throughput, low latency, and resiliency.
: A cloud platform to build powerful web and mobile apps that connect to data anywhere;
in the cloud or on-premises. Build engaging mobile apps for iOS, Android, and Windows. Integrate with your
Software as a Service (SaaS) and enterprise applications with out-of-the-box connectivity to dozens of cloud-
based services and enterprise applications. Code in your favorite language and IDE—.NET, Node.js, PHP,
Python, or Java—to build web apps and APIs faster than ever.
: The Logic Apps feature of Azure App Service helps integrate your IoT solution to your existing
line-of-business systems and automate workflow processes. Logic Apps enables developers to design
workflows that start from a trigger and then execute a series of steps—rules and actions that use powerful
connectors to integrate with your business processes. Logic Apps offers out-of-the-box connectivity to a vast
ecosystem of SaaS, cloud-based, and on-premises applications.
: Reliable, economical cloud storage for the data that your devices send to the cloud.
Next steps
To learn more about securing your IoT solution, see:
IoT Security Best Practices
IoT Security Architecture
Secure your IoT deployment
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Frequently asked questions for IoT Suite
You can read about IoT Hub security in Control access to IoT Hub in the IoT Hub developer guide.
Frequently asked questions for IoT Suite
1/5/2018 • 4 min to read • Edit Online
NOTE
Microsoft Azure for DreamSpark is now known as Microsoft Imagine for students.
Currently, you cannot create a preconfigured solution with a Microsoft Azure for DreamSpark account. However,
you can create a free trial account for Azure in just a couple of minutes that enables you create a preconfigured
solution.
Can I create a preconfigured solution if I have Cloud Solution Provider (CSP) subscription?
Currently, you cannot create a preconfigured solution with a Cloud Solution Provider (CSP) subscription. However,
you can create a free trial account for Azure in just a couple of minutes that enables you create a preconfigured
solution.
How do I delete an AAD tenant?
See Eric Golpe's blog post Walkthrough of Deleting an Azure AD Tenant.
Next steps
You can also explore some of the other features and capabilities of the IoT Suite preconfigured solutions:
Predictive maintenance preconfigured solution overview
Connected factory preconfigured solution overview
IoT security from the ground up
Frequently asked questions for IoT Suite connected
factory preconfigured solution
1/17/2018 • 9 min to read • Edit Online
NOTE
In either case, ensure you install the latest patches by following the instructions on the Ubuntu website. Keep the
installation up to date for as long as your VM is accessible through a public IP address.
Run .
How do I update the simulation in the VM?
If you have made any changes to the simulation, you can use the PowerShell script in the repository
using the command. This script builds all the simulation components, stops the simulation in
the VM, uploads, installs, and starts them.
How do I find out the connection string of the IoT hub used by my solution?
If you deployed your solution with the script in the repository, the connection string is the value of
in the file.
You can also find the connection string using the Azure portal. In the IoT Hub resource in the resource group of
your deployment, locate the connection string settings.
Which IoT Hub devices does the Connected factory simulation use?
The simulation self registers the following devices:
proxy.beijing.corp.contoso
proxy.capetown.corp.contoso
proxy.mumbai.corp.contoso
proxy.munich0.corp.contoso
proxy.rio.corp.contoso
proxy.seattle.corp.contoso
publisher.beijing.corp.contoso
publisher.capetown.corp.contoso
publisher.mumbai.corp.contoso
publisher.munich0.corp.contoso
publisher.rio.corp.contoso
publisher.seattle.corp.contoso
Using the DeviceExplorer or the IoT extension for Azure CLI 2.0 tool, you can check which devices are registered
with the IoT hub your solution is using. To use device explorer, you need the connection string for the IoT hub in
your deployment. To use the IoT extension for Azure CLI 2.0, you need your IoT Hub name.
How can I get log data from the simulation components?
All components in the simulation log information in to log files. These files can be found in the VM in the folder
. To retrieve the logs, you can use the PowerShell script
in the repository.
This script needs to sign in to the VM. You may need to provide credentials for the sign-in. See How do I sign in
to the simulation VM? to find the credentials.
The script adds/removes a public IP address to the VM, if it does not yet have one and removes it. The script puts
all log files in an archive and downloads the archive to your development workstation.
Alternatively log in to the VM via SSH and inspect the log files at runtime.
How can I check if the simulation is sending data to the cloud?
With the DeviceExplorer or the iothub-explorer tool, you can inspect the data sent to IoT Hub from certain
devices. To use these tools, you need to know the connection string for the IoT hub in your deployment. See How
do I find out the connection string of the IoT hub used by my solution?
Inspect the data sent by one of the publisher devices:
publisher.beijing.corp.contoso
publisher.capetown.corp.contoso
publisher.mumbai.corp.contoso
publisher.munich0.corp.contoso
publisher.rio.corp.contoso
publisher.seattle.corp.contoso
If you see no data sent to IoT Hub, then there is an issue with the simulation. As a first analysis step you should
analyze the log files of the simulation components. See How can I get log data from the simulation components?
Next, try to stop and start the simulation and if there's still no data sent, update the simulation completely. See
How do I update the simulation in the VM?
How do I enable an interactive map in my Connected factory solution?
To enable an interactive map in your Connected factory solution, you must have an existing Bing Maps API for
Enterprise plan.
When deploying from www.azureiotsuite.com, the deployment process verifies that your subscription has an
enabled Bing Maps API for Enterprise plan and automatically deploys an interactive map into Connected factory.
If this is not the case, you can still enable an interactive map in your deployment as follows:
When you deploy using the script in the Connected factory GitHub repository and you have a Bing
Maps API for Enterprise plan, set the environment variable in the build window to the query
key of your plan. The interactive map is then enabled automatically.
If you don't have a Bing Maps API for Enterprise plan, deploy the Connected factory solution from
www.azureiotsuite.com or using the script. Then add a Bing Maps API for Enterprise plan to your
subscription as explained in How do I create a Bing Maps API for Enterprise account?. Look up the query key of
this account as explained in How to obtain your Bing Maps API for Enterprise QueryKey and save this key.
Navigate to the Azure portal and access the App Service resource in your Connected factory deployment.
Navigate to , where you find a section . Set the to the
query key you obtained. Save the settings and then navigate to and restart the App Service.
How do I create a Bing Maps API for Enterprise account
You can get a free Internal Transactions Level 1 Bing Maps for Enterprise plan. However, you can only add two of
these plans to an Azure subscription. If you don't have a Bing Maps API for Enterprise account, create one in the
Azure portal by clicking . Then search for and follow the
prompts to create it.