Breyta

Deila með


Manage artifact metadata in integration accounts for Azure Logic Apps

Applies to: Azure Logic Apps (Consumption)

You can define custom metadata for artifacts in integration accounts and get that metadata during runtime for your logic app workflow to use. For example, you can provide metadata for artifacts, such as partners, agreements, schemas, and maps. All these artifact types store metadata as key-value pairs.

This how-to guide shows how to add metadata to an integration account artifact. You can then use actions in your workflow to retrieve and use the metadata values.

Prerequisites

Add metadata to artifacts

  1. In the Azure portal, go to your integration account.

  2. Select the artifact where you want to add metadata, and then select Edit.

    Screenshot of Azure portal, integration account, and 'Partners' page with 'TradingPartner1' and 'Edit' button selected.

  3. On the Edit pane, enter the metadata details for that artifact, and then select OK. The following screenshot shows three metadata key-value pairs:

    Screenshot of the 'Edit' pane for 'TradingPartner1'. Under 'Metadata', three key-value pairs are highlighted and 'OK' is selected.

  4. To view this metadata in the integration account's JavaScript Object Notation (JSON) definition, select Edit as JSON, which opens the JSON editor.

    Screenshot of the JSON code that contains information about 'TradingPartner1'. In the 'metadata' object, three key-value pairs are highlighted.

Get artifact metadata

  1. In the Azure portal, open the logic app resource that's linked to your integration account.

  2. On the logic app navigation menu, select Logic app designer.

  3. In the designer, add the Integration Account Artifact Lookup action to get the metadata.

    1. Under the trigger or an existing action, select New step.

    2. Under the Choose an operation search box, select Built-in. In the search box, enter integration account.

    3. From the actions list, select the action named Integration Account Artifact Lookup.

    Screenshot of the designer for a Consumption logic app workflow with the 'Integration Account Artifact Lookup' action selected.

  4. Provide the following information for the artifact that you want to find:

    Property Required Value Description
    Artifact Type Yes Schema, Map, Partner, Agreement, or a custom type The type for the artifact you want to get
    Artifact Name Yes <artifact-name> The name for the artifact you want to get

    This example gets the metadata for a trading partner artifact by following these steps:

    1. For Artifact Type, select Partner.

    2. For Artifact Name, click inside the edit box. When the dynamic content list appears, select the name output from the trigger.

    Screenshot of the 'Integration Account Artifact Lookup' action with the 'Artifact Type' and 'Artifact Name' properties highlighted.

  5. Now, add the action that you want to use for using the metadata. This example continues with the built-in HTTP action.

    Screenshot of the designer search box with 'http' entered, the 'Built-in' tab highlighted, and the HTTP action selected.

  6. Provide the following information for the artifact metadata that you want the HTTP action to use.

    For example, suppose you want to get the routingUrl metadata that you added earlier. Here are the property values that you might specify:

    Property Required Value Description Example value
    Method Yes <operation-to-run> The HTTP operation to run on the artifact. Use the GET method for this HTTP action.
    URI Yes <metadata-location> The endpoint where you want to send the outgoing request. To reference the routingUrl metadata value from the artifact that you retrieved, follow these steps:

    1. Click inside the URI box.

    2. In the dynamic content list that opens, select Expression.

    3. In the expression editor, enter an expression like the following example:

    outputs('Integration_Account_Artifact_Lookup')['properties']['metadata']['routingUrl']

    4. When you're done, select OK.
    Headers No <header-values> Any header outputs from the trigger that you want to pass to the HTTP action. To pass in the Content-Type value from the trigger header, follow these steps for the first row under Headers:

    1. In the first column, enter Content-Type as the header name.

    2. In the second column, use the expression editor to enter the following expression as the header value:

    triggeroutputs()['headers']['Content-Type']

    To pass in the Host value from the trigger header, follow these steps for the second row under Headers:

    1. In the first column, enter Host as the header name.

    2. In the second column, use the expression editor to enter the following expression as the header value:

    triggeroutputs()['headers']['Host']
    Body No <body-content> Any other content that you want to pass through the HTTP action's body property. To pass the artifact's properties values to the HTTP action:

    1. Click inside the Body box to open the dynamic content list. If no properties appear, select See more.

    2. From the dynamic content list, under Integration Account Artifact Lookup, select Properties.

    The following screenshot shows the example values:

    Screenshot of the designer with an HTTP action. Some property values are highlighted. The dynamic content list is open with 'Properties' highlighted.

  7. To check the information that you provided for the HTTP action, you can view your workflow's JSON definition. On the designer toolbar, select Code view.

    The workflow's JSON definition appears, as shown in the following example:

    Screenshot of the HTTP action's JSON definition with the 'body', 'headers', 'method', and 'URI' properties highlighted.

  8. On the code view toolbar, select Designer.

    Any expressions that you entered in the designer now appear resolved.

    Screenshot of the designer with the 'URI', 'Headers', and 'Body' expressions now resolved.

Next steps