Skip to content

Commit 2ec3cdc

Browse files
authored
Merge pull request #223783 from baanders/1-12-power-platform
ADT: Power platform connector
2 parents e93ca4e + 5f74e69 commit 2ec3cdc

15 files changed

+99
-225
lines changed

articles/digital-twins/.openpublishing.redirection.digital-twins.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "how-to-integrate-logic-apps.md",
5+
"redirect_url": "/azure/digital-twins/how-to-use-power-platform-logic-apps-connector",
6+
"redirect_document_id": false
7+
},
38
{
49
"source_path": "how-to-ingest-opcua-data.md",
510
"redirect_url": "https://github.com/digitaltwinconsortium/ManufacturingOntologies#manufacturing-ontologies",

articles/digital-twins/TOC.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@
119119
href: how-to-ingest-iot-hub-data.md
120120
- name: Automanage devices with DPS
121121
href: how-to-provision-using-device-provisioning-service.md
122-
- name: Integrate with Logic Apps
123-
href: how-to-integrate-logic-apps.md
122+
- name: Integrate with Power Platform and Logic Apps
123+
href: how-to-use-power-platform-logic-apps-connector.md
124124
- name: Connect output
125125
items:
126126
- name: Manage endpoints and routes
@@ -199,6 +199,8 @@
199199
href: reference-query-operators.md
200200
- name: Reserved keywords
201201
href: reference-query-reserved.md
202+
- name: Azure Digital Twins Power Platform and Logic Apps connector
203+
href: /connectors/azuredigitaltwins/
202204
- name: Resources
203205
items:
204206
- name: Digital Twins service limits
@@ -295,8 +297,6 @@
295297
href: /samples/azure-samples/digital-twins-iothub-integration/adt-iothub-provision-sample/
296298
- name: SignalR integration sample
297299
href: /samples/azure-samples/digitaltwins-signalr-webapp-sample/digital-twins-samples/
298-
- name: Custom Swaggers for Logic Apps connector
299-
href: /samples/azure-samples/digital-twins-custom-swaggers/azure-digital-twins-custom-swaggers/
300300
- name: Multivariate Anomaly Detection Toolkit
301301
href: /samples/azure-samples/digital-twins-mvad-integration/adt-mvad-integration/
302302
- name: Ontologies

articles/digital-twins/concepts-data-ingress-egress.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: Azure Digital Twins
55
description: Learn about the data ingress and egress requirements for integrating Azure Digital Twins with other services.
66
author: baanders
77
ms.author: baanders # Microsoft employees only
8-
ms.date: 07/01/2022
8+
ms.date: 01/12/2023
99
ms.topic: conceptual
1010
ms.service: digital-twins
1111

@@ -29,9 +29,9 @@ Azure Digital Twins can be driven with data and events from any service—[IoT H
2929

3030
Instead of having a built-in IoT Hub behind the scenes, Azure Digital Twins allows you to "bring your own" IoT Hub to use with the service. You can use an existing IoT Hub you currently have in production, or deploy a new one to be used for this purpose. This functionality gives you full access to all of the device management capabilities of IoT Hub.
3131

32-
To ingest data from any source into Azure Digital Twins, use an [Azure function](../azure-functions/functions-overview.md). Learn more about this pattern in [Ingest telemetry from IoT Hub](how-to-ingest-iot-hub-data.md), or try it out yourself in the Azure Digital Twins [Connect an end-to-end solution](tutorial-end-to-end.md).
32+
To ingest data from any source into Azure Digital Twins, you can use an [Azure function](../azure-functions/functions-overview.md). Learn more about this pattern in [Ingest telemetry from IoT Hub](how-to-ingest-iot-hub-data.md), or try it out yourself in the Azure Digital Twins [Connect an end-to-end solution](tutorial-end-to-end.md).
3333

34-
You can also learn how to connect Azure Digital Twins to a Logic Apps trigger in [Integrate with Logic Apps](how-to-integrate-logic-apps.md).
34+
You can also integrate Azure Digital Twins into a [Microsoft Power Platform](/power-platform) or [Azure Logic Apps](../logic-apps/logic-apps-overview.md) flow, using the [Azure Digital Twins Power Platform connector](how-to-use-power-platform-logic-apps-connector.md). For more information about connectors, see [Connectors overview](/connectors/connectors).
3535

3636
## Data egress
3737

articles/digital-twins/how-to-integrate-logic-apps.md

Lines changed: 0 additions & 211 deletions
This file was deleted.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
# Mandatory fields.
3+
title: Integrate with Power Platform and Logic Apps
4+
titleSuffix: Azure Digital Twins
5+
description: Learn how to connect Power Platform and Logic Apps to Azure Digital Twins using the connector
6+
author: baanders
7+
ms.author: baanders # Microsoft employees only
8+
ms.date: 01/25/2023
9+
ms.topic: how-to
10+
ms.service: digital-twins
11+
12+
---
13+
14+
# Integrate with Power Platform and Logic Apps using the Azure Digital Twins connector
15+
16+
You can integrate Azure Digital Twins into a [Microsoft Power Platform](/power-platform) or [Azure Logic Apps](../logic-apps/logic-apps-overview.md) flow, using the *Azure Digital Twins connector*.
17+
18+
The connector is a wrapper around the Azure Digital Twins [data plane APIs](concepts-apis-sdks.md#data-plane-apis) for twin, model and query operations, which allows the underlying service to talk to [Microsoft Power Automate](/power-automate/getting-started), [Microsoft Power Apps](/power-apps/powerapps-overview), and [Azure Logic Apps](../logic-apps/logic-apps-overview.md). The connector provides a way for users to connect their accounts and leverage a set of prebuilt actions to build their apps and workflows.
19+
20+
For more information about the Azure Digital Twins Power Platform connector, including a complete list of the connector's actions and their parameters, see the [Azure Digital Twins connector reference documentation](/connectors/azuredigitaltwins).
21+
22+
## Prerequisites
23+
24+
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
25+
Sign in to the [Azure portal](https://portal.azure.com) with your account.
26+
27+
[!INCLUDE [digital-twins-prereq-instance.md](../../includes/digital-twins-prereq-instance.md)]
28+
29+
Lastly, you'll need to set up any [Power Platform](/power-platform) services where you want to use the connector.
30+
31+
## Set up the connector
32+
33+
For Power Automate and Power Apps, set up the connection first before creating a flow. Follow the steps below to add the connection in Power Automate and Power Apps.
34+
1. Select **Connections** from the left navigation menu (in Power Automate, it's under the **Data** heading). On the Connections page, select **+ New connection**.
35+
1. Search for *Azure Digital Twins*, and select the **Azure Digital Twins (preview)** connector.
36+
1. Where the connector asks for **ADT Instance Name**, enter the [host name of your instance](how-to-set-up-instance-portal.md#verify-success-and-collect-important-values).
37+
1. Enter your authentication details when requested to finish setting up the connection.
38+
1. To verify that the connection has been created, look for it on the Connections page.
39+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/power-connection.png" alt-text="Screenshot of Power Automate, showing the Azure Digital Twins connection on the Connections page." lightbox="media/how-to-use-power-platform-logic-apps-connector/power-connection.png":::
40+
41+
For Logic Apps, you can use the Azure Digital Twins built-in connection when you [create a flow](#create-a-flow) in the next section. For more information on built-in connectors, see [Built-in connectors in Azure Logic Apps](../connectors/built-in.md).
42+
43+
## Create a flow
44+
45+
You can incorporate Azure Digital Twins into Power Automate flows, Logic Apps flows, or Power Apps applications. Using the Azure Digital Twins connector and over 700 other Power Platform connectors, you can ingest data from other systems into your twins, or respond to system events.
46+
47+
Follow the steps below to create a sample flow with the connector in Power Automate.
48+
1. In Power Automate, select **My flows** from the left navigation menu. Select **+ New flow** and **Instant cloud flow**.
49+
1. Enter a **Flow name** and select **Manually trigger a flow** from the list of triggers. **Create** the flow.
50+
1. Add a step to the flow, and search for *Azure Digital Twins* to find the connection. Select the Azure Digital Twins connection.
51+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/power-automate-action-1.png" alt-text="Screenshot of Power Automate, showing the Azure Digital Twins connector in a new flow." lightbox="media/how-to-use-power-platform-logic-apps-connector/power-automate-action-1-big.png":::
52+
1. You'll see a list of all the [actions](/connectors/azuredigitaltwins) that are available with the connector. Pick one of them to interact with the [Azure Digital Twins APIs](/rest/api/azure-digitaltwins/).
53+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/power-automate-action-2.png" alt-text="Screenshot of Power Automate, showing all the actions for the Azure Digital Twins connector." lightbox="media/how-to-use-power-platform-logic-apps-connector/power-automate-action-2-big.png":::
54+
1. You can continue to edit or add more steps to your workflow, using other connectors to build out your integration scenario.
55+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/power-automate-action-3.png" alt-text="Screenshot of Power Automate, showing a Get twin by ID action from the Azure Digital Twins connector in a flow." lightbox="media/how-to-use-power-platform-logic-apps-connector/power-automate-action-3.png":::
56+
57+
Follow the steps below to create a sample flow with the connector in Power Apps.
58+
1. In Power Apps, select **+ Create** from the left navigation menu. Select **Blank app** and follow the prompts to create a new app.
59+
1. In the app builder, select **Data** from the left navigation menu. Select **Add data** and search for *Azure Digital Twins* to find the data connection. Select the Azure Digital Twins connection.
60+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/power-apps-action-1.png" alt-text="Screenshot of Power Apps, showing the Azure Digital Twins connector as a data source." lightbox="media/how-to-use-power-platform-logic-apps-connector/power-apps-action-1.png":::
61+
1. Now, the [actions](/connectors/azuredigitaltwins) from the Azure Digital Twins connector will be available as functions to use in your app.
62+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/power-apps-action-2.png" alt-text="Screenshot of Power Apps, showing the Get twin by ID action being used in a function." lightbox="media/how-to-use-power-platform-logic-apps-connector/power-apps-action-2.png":::
63+
1. You can continue to build out your application with access to Azure Digital Twins data. For more information about building Power Apps, see [Overview of creating apps in Power Apps](/power-apps/maker/).
64+
65+
Follow the steps below to create a sample flow with the connector in Logic Apps.
66+
1. Navigate to your logic app in the [Azure portal](https://portal.azure.com). Select **Workflows** from the left navigation menu, and **+ Add**. Follow the prompts to create a new workflow.
67+
1. Select your new flow and enter into the **Designer**.
68+
1. Add a trigger to your app.
69+
1. Select **Choose an operation** to add an action from the Azure Digital Twins connector. Search for *Azure Digital Twins* on the **Azure** tab to find the data connection. Select the Azure Digital Twins connection.
70+
:::image type="content" source="media/how-to-use-power-platform-logic-apps-connector/logic-apps-action.png" alt-text="Screenshot of Logic Apps, showing the Azure Digital Twins connector." lightbox="media/how-to-use-power-platform-logic-apps-connector/logic-apps-action.png":::
71+
1. You'll see a list of all the [actions](/connectors/azuredigitaltwins) that are available with the connector. Pick one of them to interact with the [Azure Digital Twins APIs](/rest/api/azure-digitaltwins/).
72+
1. After selecting an action from the Azure Digital Twins connector, you'll be asked to enter authentication details to create the connection.
73+
1. You can continue to edit or add more steps to your workflow, using other connectors to build out your integration scenario.
74+
75+
## Limitations and suggestions
76+
77+
Here are some limitations of the connector and suggestions for working with them.
78+
79+
* Some connector actions (such as Add Model) require input in the form of a literal string that starts with *@*. In these cases, escape the *@* character by using *@@* instead. This will keep the literal value from being interpreted as a JSON expression.
80+
* Since Azure Digital Twins deals with dynamic schema responses, you should parse the JSON received from the APIs before consuming it in your application. For example, here's a set of calls that parse the data before extracting the `dtId` value: `Set(jsonVal, AzureDigitalTwins.GetTwinById("your_twin_id").result); Set(parsedResp, ParseJSON(jsonVal)); Set( DtId, Text(parsedResp.'$dtId'));`.
81+
82+
## Next steps
83+
84+
For more information about Power Platform connectors, including how to use them in workflows across multiple products, see the [Power Platform and Azure Logic Apps connectors documentation](/connectors/connectors).
199 KB
Loading
157 KB
Loading
100 KB
Loading
141 KB
Loading
123 KB
Loading

0 commit comments

Comments
 (0)