Skip to content

Commit 2059325

Browse files
Merge pull request #293756 from dominicbetts/iiot-grafana
IoT: Add Grafana details back to industrial tutorial.
2 parents b2fc68b + 00557f4 commit 2059325

File tree

1 file changed

+77
-2
lines changed

1 file changed

+77
-2
lines changed

articles/iot/tutorial-iot-industrial-solution-architecture.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The following table describes the key components in this solution:
5959
| [UA Edge Translator](https://github.com/opcfoundation/ua-edgetranslator) | This open-source industrial connectivity reference application translates from proprietary asset interfaces to OPC UA. The solution uses the W3C Web of Things descriptions as the schema to describe the industrial asset interface. |
6060

6161
> [!NOTE]
62-
> In a real-world deployment, something as critical as opening a pressure relief valve would be done on-premises. This is just a simple example of how to achieve the digital feedback loop.
62+
> In a real-world deployment, something as critical as opening a pressure relief valve would be done on-premises. This example simply demonstrates how to achieve the digital feedback loop.
6363
6464
## Production line simulation
6565

@@ -209,7 +209,7 @@ Before you deploy Azure IoT Operations, confirm that you started the production
209209
210210
### Configure your Azure IoT Operations deployment
211211

212-
You can configure your Azure IoT Operations deployment by using the [operations experience](https://iotoperations.azure.com/) web UI. Add the asset endpoints, assets and data flows to process the data from the production line simulation and route it to the **data** hub in your Event Hubs namespace.
212+
You can configure your Azure IoT Operations deployment by using the [operations experience](https://iotoperations.azure.com/) web UI. Add the asset endpoints, assets, and data flows to process the data from the production line simulation and route it to the **data** hub in your Event Hubs namespace.
213213

214214
In your Azure IoT Operations deployment, create asset endpoints that define connections to the following OPC UA servers in the production simulation:
215215

@@ -255,6 +255,81 @@ For best results, change the `Layout` option to `Grouped`.
255255

256256
:::image type="content" source="media/concepts-iot-industrial-solution-architecture/isa-95-graph.png" alt-text="Graph that shows an ISA-95 asset hierarchy." lightbox="media/concepts-iot-industrial-solution-architecture/isa-95-graph.png" border="false" :::
257257

258+
## Use Azure Managed Grafana
259+
260+
You can also use Azure Managed Grafana to create a dashboard on Azure for the solution described in this article. Use Grafana within manufacturing to create dashboards that display real-time data. The following steps show you enable Grafana on Azure, and create a dashboard with the simulated production line data from Azure Data Explorer.
261+
262+
### Enable the Azure Managed Grafana service
263+
264+
To create an Azure Managed Grafana service, and configure it with permissions to access the ontologies database:
265+
266+
1. In the Azure portal, search for *Grafana*, and then select the **Azure Managed Grafana** service.
267+
268+
1. To create the service, on the **Create Grafana Workspace** page enter a name your instance. Choose all the default options.
269+
270+
1. After the service is created, make sure your Grafana instance has a system assigned managed identity, navigate to the **Identity** blade of your Azure Managed Grafana instance in the Azure portal. If the system assigned managed identity isn't enabled, enable it. Make a note of the **Object (principal) ID** value, you need it later.
271+
272+
1. To grant permission for the managed identity to access the ontologies database in Azure Data Explorer:
273+
274+
1. Navigate to the **Permissions** blade of the ontologies database in your Azure Data Explorer instance in the Azure portal.
275+
1. Select **Add > AllDatabasesViewer**.
276+
1. Search for and select the **Object (principal) ID** value, you made a note of previously.
277+
278+
### Add a new data source in Grafana
279+
280+
Add a new data source to connect to Azure Data Explorer. In this sample, you use a system assigned managed identity to connect to Azure Data Explorer. To configure the authentication, follow these steps:
281+
282+
To add the data source in Grafana, follow these steps:
283+
284+
1. Navigate to the endpoint URL for your Grafana instance. You can find the endpoint URL in the Azure Managed Grafana page for your instance in the Azure portal. Then sign in to your Grafana instance.
285+
286+
1. In the Grafana dashboard, select **Connections > Data sources**, and then select **Add new data source**. Scroll down and select **Azure Data Explorer Datasource**.
287+
288+
1. Choose **Managed Identity** as the authentication menu. Then add the URL of your Azure Data Explorer cluster. You can find the URL in the Azure Data Explorer instance menu in the Azure portal under **URI**.
289+
290+
1. Select **Save and test** to verify the datasource connection.
291+
292+
### Import a sample dashboard
293+
294+
Now you're ready to import the sample dashboard.
295+
296+
1. Download the [Sample Grafana Manufacturing Dashboard](https://github.com/digitaltwinconsortium/ManufacturingOntologies/blob/main/Tools/GrafanaDashboard/samplegrafanadashboard.json) dashboard.
297+
298+
1. In the Grafana menu, navigate to **Dashboards** and then select **New > Import**.
299+
300+
1. Select **Upload dashboard JSON file** and select the *samplegrafanadashboard.json* file that you downloaded previously. Select **Import**.
301+
302+
1. For each of the panels in the dashboard, select **Edit** and then select the **Data source** you setup previously.
303+
304+
### Configure alerts
305+
306+
In Grafana, you can also create alerts. In this example, you create a low OEE alert for one of the production lines.
307+
308+
1. In the Grafana menu, navigate to **Alerting > **Alert rules**.
309+
310+
1. Select **New alert rule**.
311+
312+
1. Give your alert a name and select **Azure Data Explorer** as data source. Select **KQL** in the **Define query and alert condition** pane.
313+
314+
1. In the query field, enter the following query. This example uses the Seattle production line:
315+
316+
```kql
317+
let oee = CalculateOEEForStation("assembly", "seattle", 10000, now(), now(-1h));
318+
print round(oee * 100, 2)
319+
```
320+
321+
1. Select **Set as alert condition**.
322+
323+
1. Scroll down to the **Expressions** section. Delete the **Reduce** expression, you don't need it.
324+
325+
1. For the alert threshold, select **A** as **Input**. Select **IS BELOW** and enter **10**.
326+
327+
1. Scroll down to the **Set evaluation behavior** section. Create a new **Folder** to save your alerts. Create a new **Evaluation group** and specify **2m**.
328+
329+
1. Select the **Save rule and exit** button in the top right.
330+
331+
In the overview of your alerts, you can now see that an alert is triggered when your OEE is less than 10.
332+
258333
## Connect the reference solution to Microsoft Power BI
259334
260335
To connect the reference solution Power BI, you need access to a Power BI subscription.

0 commit comments

Comments
 (0)