Skip to content

Commit ca9e696

Browse files
authored
Merge pull request #265657 from ecfan/net
Azure Logic Apps: More info about adding .NET assemblies and XML extension objects
2 parents 3d62ec4 + c790b79 commit ca9e696

6 files changed

+88
-41
lines changed

articles/logic-apps/logic-apps-enterprise-integration-maps.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ services: logic-apps
55
ms.suite: integration
66
ms.reviewer: estfan, azla
77
ms.topic: how-to
8-
ms.date: 10/04/2023
8+
ms.date: 02/08/2024
99
---
1010

1111
# Add maps for transformations in workflows with Azure Logic Apps
1212

13+
[!INCLUDE [logic-apps-sku-consumption-standard](../../includes/logic-apps-sku-consumption-standard.md)]
14+
1315
Workflow actions such as **Transform XML** and **Liquid** require a map to perform their tasks. For example, the **Transform XML** action requires a map to convert XML between formats. A map is an XML document that uses [Extensible Stylesheet Language Transformation (XSLT)](https://www.w3.org/TR/xslt/) language to describe how to convert data from XML to another format and has the .xslt file name extension. The map consists of a source XML schema as input and a target XML schema as output. You can define a basic transformation, such as copying a name and address from one document to another. Or, you can create more complex transformations using the out-of-the-box map operations. You can manipulate or control data by using different built-in functions, such as string manipulations, conditional assignments, arithmetic expressions, date time formatters, and even looping constructs.
1416

1517
For example, suppose you regularly receive B2B orders or invoices from a customer who uses the YearMonthDay date format (YYYYMMDD). However, your organization uses the MonthDayYear date format (MMDDYYYY). You can define and use a map that transforms the YYYYMMDD format to the MMDDYYYY format before storing the order or invoice details in your customer activity database.
1618

17-
This how-to guide shows how to add a map to your integration account. If you're working with a Standard logic app workflow, you can also add a map directly to your logic app resource.
19+
This guide shows how to add a map for your workflow to use. You can add maps either to your linked integration account, or if you have a Standard logic app, you can add maps directly to your logic app resource.
1820

1921
## Prerequisites
2022

@@ -128,7 +130,7 @@ Your map must have the following attributes and a `CDATA` section that contains
128130

129131
* `namespace` is the namespace in your assembly that includes the custom code.
130132

131-
The following example shows a map that references an assembly named `XslUtilitiesLib` and calls the `circumference` method from the assembly.
133+
The following example shows a map that references an assembly named **XslUtilitiesLib** and calls the `circumference` method from the assembly.
132134

133135
```xml
134136
<?xml version="1.0" encoding="UTF-8"?>
@@ -244,26 +246,36 @@ After your assembly finishes uploading, the assembly appears in the **Assemblies
244246

245247
### [Standard](#tab/standard)
246248

247-
A Standard logic app resource supports referencing external assemblies from maps, which enable directly calling custom .NET code from XSLT maps. For more information about this capability, see [Create and run .NET Framework code from Standard workflows](create-run-custom-code-functions.md).
249+
A Standard logic app resource supports referencing external assemblies from maps, which enable directly calling custom .NET code from XSLT maps:
250+
251+
| Assembly type | Description |
252+
|---------------|-------------|
253+
| **Client/SDK Assembly (.NET Framework)** | This assembly type provides storage and deployment of client and custom SDK for the .NET Framework. For example, the [SAP built-in connector](/azure/logic-apps/connectors/built-in/reference/sap/) uses these assemblies to load the SAP NCo non-redistributable DLL files. |
254+
| **Client/SDK Assembly (Java)** | This assembly type provides storage and deployment of custom SDK for Java. For example, the [JDBC built-in connector](/azure/logic-apps/connectors/built-in/reference/jdbc/) uses these JAR files to find JDBC drivers for custom relational databases (RDBs). |
255+
| **Custom Assembly (.NET Framework)** | This assembly type provides storage and deployment of custom DLLs. For example, the [**Transform XML** operation](logic-apps-enterprise-integration-transform.md) uses these assemblies for the custom transformation functions that are required during XML transformation. |
256+
257+
For more information about this capability, see [Create and run .NET Framework code from Standard workflows](create-run-custom-code-functions.md).
258+
259+
#### Azure portal
248260

249261
1. In the [Azure portal](https://portal.azure.com) search box, find and open your logic app resource.
250262

251263
1. On the logic app menu, under **Artifacts**, select **Assemblies**.
252264

253265
1. On the **Assemblies** page toolbar, select **Add**. On the **Add Assembly** pane, under **Assembly Type**, select the following type for your assembly, based on your scenario:
254266

255-
| Assembly type | Description |
256-
|---------------|-------------|
257-
| **Client/SDK Assembly (.NET Framework)** | This assembly type provides storage and deployment of client and custom SDK for the .NET Framework. For example, the [SAP built-in connector](/azure/logic-apps/connectors/built-in/reference/sap/) uses these assemblies to load the SAP NCo non-redistributable DLL files. |
258-
| **Client/SDK Assembly (Java)** | This assembly type provides storage and deployment of custom SDK for Java. For example, the [JDBC built-in connector](/azure/logic-apps/connectors/built-in/reference/jdbc/) uses these JAR files to find JDBC drivers for custom relational databases (RDBs). |
259-
| **Custom Assembly (.NET Framework)** | This assembly type provides storage and deployment of custom DLLs. For example, the [**Transform XML** operation](logic-apps-enterprise-integration-transform.md) uses these assemblies for the custom transformation functions that are required during XML transformation. |
260-
261267
1. Now, either drag-and-drop your assemblies to the **Upload Files** area, or browse to and select your assemblies.
262268

263269
1. When you're done, select **Upload Files**.
264270

265271
Your selected assemblies now appear on your logic app's **Assemblies** page.
266272

273+
#### Visual Studio Code
274+
275+
1. In your Standard logic app project, open the following folders: **Artifacts** > **lib** > **custom** > **net472**.
276+
277+
1. Add your assemblies to the **net472** folder.
278+
267279
---
268280

269281
<a name="add-map"></a>
@@ -328,7 +340,7 @@ The following steps apply only if you want to add a map directly to your Standar
328340

329341
1. On the **Maps** pane toolbar, select **Add**.
330342

331-
1. On the **Add Map** pane, enter a unique name for your map and include the `.xslt` extension name.
343+
1. On the **Add Map** pane, enter a unique name for your map and include the **.xslt** extension name.
332344

333345
1. Next to the **Map** box, select the folder icon. Select the map to upload.
334346

@@ -374,7 +386,7 @@ To update an existing map, you have to upload a new map file that has the change
374386

375387
1. On the **Maps** pane toolbar, select **Add**.
376388

377-
1. Under **Add map**, enter a unique name for your map and include the `.xslt` extension name.
389+
1. Under **Add map**, enter a unique name for your map and include the **.xslt** extension name.
378390

379391
1. Next to the **Map** box, select the folder icon. Select the map to upload.
380392

articles/logic-apps/logic-apps-enterprise-integration-transform.md

Lines changed: 64 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ author: divyaswarnkar
77
ms.author: divswa
88
ms.reviewer: estfan, azla
99
ms.topic: how-to
10-
ms.date: 10/04/2023
10+
ms.date: 02/08/2024
1111
---
1212

1313
# Transform XML in workflows with Azure Logic Apps
1414

1515
[!INCLUDE [logic-apps-sku-consumption-standard](../../includes/logic-apps-sku-consumption-standard.md)]
1616

17-
In enterprise integration business-to-business (B2B) scenarios, you might have to convert XML between formats. Your logic app workflow can transform XML by using the **Transform XML** action and a predefined [*map*](logic-apps-enterprise-integration-maps.md). For example, suppose you regularly receive B2B orders or invoices from a customer that uses the YearMonthDay date format (YYYYMMDD). However, your organization uses the MonthDayYear date format (MMDDYYYY). You can create and use a map that transforms the YearMonthDay format to the MonthDayYear format before storing the order or invoice details in your customer activity database.
17+
In enterprise integration business-to-business (B2B) scenarios, you might have to convert XML between formats. Your logic app workflow can transform XML by using the **Transform XML** action and a predefined [*map*](logic-apps-enterprise-integration-maps.md).
1818

19-
If you're new to logic apps, review [What is Azure Logic Apps](logic-apps-overview.md)? For more information about B2B enterprise integration, review [B2B enterprise integration workflows with Azure Logic Apps and Enterprise Integration Pack](logic-apps-enterprise-integration-overview.md).
19+
For example, suppose you regularly receive B2B orders or invoices from a customer that uses the YearMonthDay date format (YYYYMMDD). However, your organization uses the MonthDayYear date format (MMDDYYYY). You can create and use a map that transforms the YearMonthDay format to the MonthDayYear format before storing the order or invoice details in your customer activity database.
2020

2121
## Prerequisites
2222

@@ -44,73 +44,108 @@ If you're new to logic apps, review [What is Azure Logic Apps](logic-apps-overvi
4444

4545
> [!NOTE]
4646
>
47-
> The Liquid built-in connector lets you select a map that you previously uploaded to your logic app resource or to a linked integration account, but not both.
47+
> The Liquid built-in connector lets you select a map that you previously uploaded to your logic app resource or to a linked integration account, but not both.
4848
4949
So, if you don't have or need an integration account, you can use the upload option. Otherwise, you can use the linking option. Either way, you can use these artifacts across all child workflows within the same logic app resource.
5050

5151
You still need an integration account to store other artifacts, such as partners, agreements, and certificates, along with using the [AS2](logic-apps-enterprise-integration-as2.md), [X12](logic-apps-enterprise-integration-x12.md), and [EDIFACT](logic-apps-enterprise-integration-edifact.md) operations.
5252

5353
## Add Transform XML action
5454

55-
1. In the [Azure portal](https://portal.azure.com), open your logic app resource and workflow in designer view.
55+
### [Standard](#tab/standard)
5656

57-
1. If you have a blank workflow that doesn't have a trigger, add any trigger you want. This example uses the Request trigger. Otherwise, continue to the next step.
57+
1. In the [Azure portal](https://portal.azure.com), open your Standard logic app and workflow in the designer.
5858

59-
To add the Request trigger, in the designer search box, enter `HTTP request`, and select the Request trigger named **When an HTTP request is received**.
59+
1. If you have a blank workflow that doesn't have a trigger, [follow these general steps to add any trigger you want](create-workflow-with-trigger-or-action.md?tabs=standard#add-trigger). Otherwise, continue to the next step.
6060

61-
1. Under the step in your workflow where you want to add the **Transform XML** action, choose one of the following steps:
61+
This example uses the **Request** trigger.
6262

63-
For a Consumption or ISE-based logic app workflow, choose a step:
63+
1. Under the step in your workflow where you want to add the **Transform XML** action, [follow these general steps to add the action named **Transform XML**](create-workflow-with-trigger-or-action.md?tabs=standard#add-action).
6464

65-
* To add the **Transform XML** action at the end of your workflow, select **New step**.
65+
1. In the **Content** box, specify the XML content that you want to transform using any XML data that you receive in the HTTP request.
6666

67-
* To add the **Transform XML** action between existing steps, move your pointer over the arrow that connects those steps so that the plus sign (**+**) appears. Select that plus sign, and then select **Add an action**.
67+
1. To select outputs from previous operations in the workflow, in the **Transform XML** action, click inside the **Content** box, and select the dynamic content list option (lightning icon).
6868

69-
For a Standard-based logic app workflow, choose a step:
69+
1. From the dynamic content list, select the token for the content that you want to transform.
7070

71-
* To add the **Transform XML** action at the end of your workflow, select the plus sign (**+**), and then select **Add an action**.
71+
![Screenshot shows Standard workflow with opened dynamic content list.](./media/logic-apps-enterprise-integration-transform/open-dynamic-content-list-standard.png)
7272

73-
* To add the **Transform XML** action between existing steps, select the plus sign (**+**) that appears between those steps, and then select **Add an action**.
73+
This example selects the **Body** token from the trigger.
7474

75-
1. Under **Choose an operation**, select **Built-in**. In the search box, enter `transform xml`. From the actions list, select **Transform XML**.
75+
> [!NOTE]
76+
>
77+
> Make sure that you select XML content. If the content isn't XML or is base64-encoded,
78+
> you must specify an expression that processes the content. For example, you can use
79+
> [expression functions](workflow-definition-language-functions-reference.md),
80+
> such as `base64ToBinary()` to decode content or `xml()` to process the content as XML.
81+
82+
1. From the **Map Source** list, select the location where you uploaded your map, either your **LogicApp** resource or your **IntegrationAccount**.
83+
84+
1. From the **Map** list, select your map.
85+
86+
1. When you're done, save your workflow.
87+
88+
You're now finished setting up your **Transform XML** action. In a real world app, you might want to store the transformed data in a line-of-business (LOB) app such as SalesForce. To send the transformed output to Salesforce, add a Salesforce action.
89+
90+
1. To test your transformation action, trigger and run your workflow. For example, for the Request trigger, send a request to the trigger's endpoint URL.
91+
92+
The **Transform XML** action runs after your workflow is triggered and when XML content is available for transformation.
7693

77-
1. To specify the XML content for transformation, you can use any XML data you receive in the HTTP request. Click inside the **Content** box so that the dynamic content list appears.
94+
### [Consumption](#tab/consumption)
7895

79-
The dynamic content list shows property tokens that represent the outputs from the previous steps in the workflow. If the list doesn't show an expected property, check the trigger or action heading in the list and whether you can select **See more**.
96+
1. In the [Azure portal](https://portal.azure.com), open your Consumption logic app and workflow in the designer.
8097

81-
For a Consumption or ISE-based logic app workflow, the designer looks like this example:
98+
1. If you have a blank workflow that doesn't have a trigger, [follow these general steps to add any trigger you want](create-workflow-with-trigger-or-action.md?tabs=consumption#add-trigger). Otherwise, continue to the next step.
8299

83-
![Screenshot showing multi-tenant designer with opened dynamic content list, cursor in "Content" box, and opened dynamic content list.](./media/logic-apps-enterprise-integration-transform/open-dynamic-content-list-multi-tenant.png)
100+
This example uses the **Request** trigger.
84101

85-
For a Standard logic app workflow, the designer looks like this example:
102+
1. Under the step in your workflow where you want to add the **Transform XML** action, [follow these general steps to add the action named **Transform XML**](create-workflow-with-trigger-or-action.md?tabs=consumption#add-action).
86103

87-
![Screenshot showing single-tenant designer with opened dynamic content list, cursor in "Content" box, and opened dynamic content list](./media/logic-apps-enterprise-integration-transform/open-dynamic-content-list-single-tenant.png)
104+
1. In the **Content** box, specify the XML content that you want to transform using any XML data that you receive in the HTTP request.
88105

89-
1. From the dynamic content list, select the property token for the content you want to validate.
106+
1. To select outputs from previous operations in the workflow, in the **Transform XML** action, click inside the **Content** box, which opens the dynamic content list.
90107

91-
This example selects the **Body** token from the trigger.
108+
1. From the dynamic content list, select the token for the content that you want to transform.
92109

93-
> [!NOTE]
94-
> Make sure that the content you select is XML. If the content is not XML or is base64-encoded, you must specify an expression
95-
> that processes the content. For example, you can use [expression functions](workflow-definition-language-functions-reference.md),
96-
> such as `base64ToBinary()` to decode content or `xml()` to process the content as XML.
110+
![Screenshot shows Consumption workflow with opened dynamic content list and cursor in Content box.](./media/logic-apps-enterprise-integration-transform/open-dynamic-content-list-consumption.png)
97111

98-
1. To specify the map to use for transformation, open the **Map** list, and select the map that you previously added.
112+
This example selects the **Body** token from the trigger.
99113

100-
1. When you're done, make sure to save your logic app workflow.
114+
> [!NOTE]
115+
>
116+
> Make sure that you select XML content. If the content isn't XML or is base64-encoded,
117+
> you must specify an expression that processes the content. For example, you can use
118+
> [expression functions](workflow-definition-language-functions-reference.md),
119+
> such as `base64ToBinary()` to decode content or `xml()` to process the content as XML.
120+
121+
1. From the **Map** list, select your map.
122+
123+
1. When you're done, save your workflow.
101124

102125
You're now finished setting up your **Transform XML** action. In a real world app, you might want to store the transformed data in a line-of-business (LOB) app such as SalesForce. To send the transformed output to Salesforce, add a Salesforce action.
103126

104127
1. To test your transformation action, trigger and run your workflow. For example, for the Request trigger, send a request to the trigger's endpoint URL.
105128

106129
The **Transform XML** action runs after your workflow is triggered and when XML content is available for transformation.
107130

131+
---
132+
108133
## Advanced capabilities
109134

110135
### Reference assemblies or call custom code from maps
111136

112137
The **Transform XML** action supports referencing external assemblies from maps, which enable directly calling custom .NET code from XSLT maps. For more information, see [Add XSLT maps for workflows in Azure Logic Apps](logic-apps-enterprise-integration-maps.md).
113138

139+
### Reference extension objects
140+
141+
In Standard workflows, the **Transform XML** action supports specifying an XML extension object to use with your map.
142+
143+
1. In the **Transform XML** action, open the **Advanced parameters** list, and select **XML Extension Object**, which adds the parameter to the action.
144+
145+
1. In the **XML Extension Object** box, specify your extension object, for example:
146+
147+
:::image type="content" source="media/logic-apps-enterprise-integration-transform/xml-extension-object-standard.png" alt-text="Screenshot shows Transform XML action with XML Extension Object parameter and value." lightbox="media/logic-apps-enterprise-integration-transform/xml-extension-object-standard.png":::
148+
114149
### Byte order mark
115150

116151
By default, the response from the transformation starts with a byte order mark (BOM). You can access this functionality only when you work in the code view editor. To disable this functionality, set the `transformOptions` property to `disableByteOrderMark`:
32.1 KB
Loading
32.7 KB
Loading

0 commit comments

Comments
 (0)