Azure Integration with complex mapping & transformation

Baharul Islam 216 Reputation points
2022-03-11T13:19:53.407+00:00

Hi Expert,
We are using Azure Integration where need to integrate between two system. But before sending data to target system we need enrich data with some complex mapping & transformation (like different mapping different type of input type as well defaulting some values).

Here getting first data as input body and subsequently need to call some 3rd party API to get additional data.

What is the best layer & efficient way to achieve this type of mapping ?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,543 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kamlesh Kumar 3,866 Reputation points
    2022-03-11T18:37:09.33+00:00

    Hi There,

    Thank you for asking this question on the Microsoft Q&A Platform.

    As you mentioned, you are already using Azure Integration so I assume you already have an Integration account where you can store your map/schema.

    For your scenario, you can achieve it in multiple ways, I am giving some suggestion that you can take,

    1. Build a LogicApp and implement the mapping as per your data transformation rule. Even if you have 3rd party call in between to pull and add the additional data, I would suggest this option will be much easier to achieve it. Here you can go with XSLT or Liquid map.
    2. You can write a function to do obj-obj mapping based on your input received from 3rd party API. This would be much tricky but again it's possible in this way as well.

    Regards,
    Kamlesh Kumar
    BizTalk Techie

    If this answer solved your problem, please click the Verify Answer button (found below the answer) to help other users who have the same question.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sudipta Chakraborty 1,116 Reputation points
    2022-03-11T18:26:14.563+00:00

    You can use Azure API Management (APIM) service and write different policies for manipulating requests as well as integrating with third party services.

    References:
    https://learn.microsoft.com/en-us/azure/api-management/api-management-policies
    https://learn.microsoft.com/en-us/azure/api-management/api-management-advanced-policies#SendRequest

    The sample policy shows one way to verify a reference token with an authorization server:

    <inbound>  
      <!-- Extract Token from Authorization header parameter -->  
      <set-variable name="token" value="@(context.Request.Headers.GetValueOrDefault("Authorization","scheme param").Split(' ').Last())" />  
      
      <!-- Send request to Token Server to validate token (see RFC 7662) -->  
      <send-request mode="new" response-variable-name="tokenstate" timeout="20" ignore-error="true">  
        <set-url>https://microsoft-apiappec990ad4c76641c6aea22f566efc5a4e.azurewebsites.net/introspection</set-url>  
        <set-method>POST</set-method>  
        <set-header name="Authorization" exists-action="override">  
          <value>basic dXNlcm5hbWU6cGFzc3dvcmQ=</value>  
        </set-header>  
        <set-header name="Content-Type" exists-action="override">  
          <value>application/x-www-form-urlencoded</value>  
        </set-header>  
        <set-body>@($"token={(string)context.Variables["token"]}")</set-body>  
      </send-request>  
      
      <choose>  
            <!-- Check active property in response -->  
            <when condition="@((bool)((IResponse)context.Variables["tokenstate"]).Body.As<JObject>()["active"] == false)">  
                <!-- Return 401 Unauthorized with http-problem payload -->  
                <return-response>  
                    <set-status code="401" reason="Unauthorized" />  
                    <set-header name="WWW-Authenticate" exists-action="override">  
                        <value>Bearer error="invalid_token"</value>  
                    </set-header>  
                </return-response>  
            </when>  
        </choose>  
      <base />  
    </inbound>  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.