For 2024, I have challenged my team to every Friday to publish a fact about the technologies we work on every day. The base rules will be:
This has to be an easy-to-read post.
The fact can be virtually everything: a tip, a best practice, a workaround, an opinion, a fact, a tool, and so on.
And this will be the first one! But before we start I feel I need to explain the featured image of this series of posts! For fun, I asked ChatGPT to generate a 16:9 picture with the following context:
Three male friends on a Friday night at a pub:
The first man with a beard is drinking beer (Luis Rigueira).
The second man is bald and has no beard. He is drinking wine. (me)
And the third man has glasses, he doesn’t have a beard, and he is drinking Coke soda. (Diogo Formosinho)
This was the end result:
Now, the fun part: by mistake, I misspelled beer and wrote bear – that is the reason for the bear in the picture if you are wondering :)… but we decided to call him “the traitor” (he knows who he is!!)
Now, to start this series of blog posts, I have selected this fact: if you need to perform an XML Schema validation using the Integration Account, please remember that the Integration Account doesn’t support nested schemas, at least yet! The beauty of Azure is that everything changes at a fast pace, and new features arrive almost every day.
The import element inside XML Schemas is used to add multiple schemas with different target namespaces to a document. This allows us, for example, to create common objects that are reused inside several schemas.
For example, this XML payload:
Sandro
Pereira
1978-04-04
Porto
1
It has two objects: the Person and the Address. If we open the Person Schema, we realize that there is an importation for the Address Schema inside:
If you have this scenario in your hands, unfortunately, I have to tell you that the Integration Account doesn’t support it. And you will end up with the following error:
The provided schema content is not valid. If the schema has any references, please upload the referenced schemas to the Integration Account first. The compilation of schema failed with error: ‘The ‘http://POC.ValidateInboundXMLMessages.Address:Address’ element is not declared.’.
How can we fix this? Well, this is a subject for another blog post and not for a Friday Fact!
Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego!
Author: Sandro Pereira
Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.
He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira
An Integration Account allows you to build Logic Apps with enterprise B2B capabilities by adding various necessary artifacts. It serves as a central repository for managing various integration assets such as schemas, maps, certificates, and trading partner agreements.
While nowadays, Logic App Standard natively supports Schemas and maps (without the need for an Integration Account), and there is a new transformation editor called Data Mapper (still in preview). Logic App Consumption still requires us to use the Integration Account and still uses the “old kind of related BizTalk Server Mapper”.
Pre-requirements
So, for us to create, in our developer environment, Schemas and Maps for Logic App Consumption to be used inside an Integration Account we need to install Azure Logic Apps Enterprise Integration Toolsextension for Visual Studio 2019 – unfortunately, there is no support for recent versions of Visual Studio. To do that, we need to:
Download and Install the extension from the Visual Studio Marketplace:
Or install it directly on Visual Studio by:
Open Visual Studio 2019, and on the Extensions menu, select the option Manage Extensions.
Search for Logic App, and then from the list, select todownload and install the Azure Logic Apps Enterprise Integration Tools.
You will probably need to restart Visual Studio.
Create an Integration Account Project
Now that we have installed everything that we need to create a new Integration Account Project, we need to:
Open Visual Studio 2019 and on the What would you like to do? window select the Create a new project option.
On the Create a new project window, search for Integration Account, and from the list below, select the Integration Account template, then click Next.
On the Configure your new project window, do the following configurations and then click Create:
On the Project name property, set a proper name for your project.
On the Location property, set the path where you want to create the project.
On the Solution name property, set a proper name for your project.
Note that a solution is a container for one or more projects in Visual Studio.
After that, a new Integration Account project is created where you can create your Schemas, Flat File Schemas, and Maps. To do that, you just need to:
Right-click on the project name and then select the option Add > New Item…
On the Add New Item window, on the left tree, select the option Logic Apps, and all the possible artifacts for you to create will be present.
Select the type.
Give it a proper name.
And click Add.
Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego!
Some of the various artifacts that can be added with an integration account are: Schemas: These are standard . xsd files containing the definition of an XML message
Author: Sandro Pereira
Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc.
He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.
View all posts by Sandro Pereira
In this post, I will show you how to get started and build an EAI solution using Enterprise Integration Pack in Logic Apps. You can also refer my last blog post for Enterprise Integration Pack overview.
To build the EAI solution, we can use pre-built connectors to establish connection with different business applications.
Integration Account Connector
Here are the basic steps required to build an enterprise workflow in Logic Apps as described in Azure documentation.
Add schema, maps, certificates, partners and agreement to the integration account for the EAI/B2B solution
Create a logic app and link the logic app to the integration account
Now build the enterprise workflow in Logic App using the artifacts stored in the integration account.
We will begin with very simple scenario, to convert a flat file order message to XML message and insert the records in a SQL table.
The workflow would use the Flat File Decoding, XML Validation, and Transform XML to produce the XML response with TotalAmount for each order as shown here:
Workflow would then iterate through each order record and insert the order to the table HighOrder in Azure SQL.
Create an Integration Account in the Azure portal
Log in to Azure portal and search for integration account.
Now enter the Name for the integration account and select the Subscription, Resourcegroup, and Location, as shown here. Click on the Create button.
Create schema and maps
The next step would be to create schemas and maps for our solution and add them to integration account. We need to use an Enterprise Integration Tool, which is really just Visual Studio extensions that give you the BizTalk schema editor and mapper in Visual Studio 2015.
You need to use IntegrationFFSchema, IntegrationSchema, and IntegrationMap in Visual Studio 2015 to create enterprise-class schemas defining an order–one Flat File Schema, one XML schema, and a map converting one format to another.
The map is very simple. It just multiplies Quantity and ItemName in the inbound message into the TotalAmount outbound field in the XML schema. The mapper includes the Functoids for basic calculations, logical conditions, and string manipulation.
Add schema, maps the integration account
Now we need to upload the schemas and map to integration account so that we can use them in Logic Apps. Integration account does not take the DLLs, so we need to upload the raw XSD and XSLT maps.
Create a Logic App and link the logic app to the integration account
The next step is to create a Logic App and link the Logic App to the integration account. I have created a Logic App – EAIOrderMessaging.
To link it to the integration account, SampleIntegrationAccount, under Settings section of Logic App, click on IntegrationAccount.
Build the enterprise workflow in Logic App using the artifacts stored in the integration account.
Now we can go back to Logic App and start using the integration account artifacts there.
Select the Order_FF in Flat File Decoding and XML Validation actions respectively, as shown here:
Once comma-separated order payload is decoded and validated, the next step would be to transform the order message using Transform XML action, as shown here:
To get the XML response from the map, we are using the Response action, as follows:
Now save the Logic App to create the URL endpoint in the Request trigger, as follows:
Copy the complete URL by clicking on the copy button as shown in the preceding screenshot. Now we can use this URL to test the workflow using the Postman application.
So, here is complete end-to-end workflow which takes in a flat file, validates the flat file using the Flat File Schema, uses a built-in check to see that it’s a decoded flat file, executes maps, and finally returns the XML response back.
This Logic App workflow now can be extended in various way. For example, instead of HTTP Request trigger, we can use FILE or FTP trigger, and the final XML response can be pushed to the Service Bus topic so that it can be subscribed by the on-premise line of business systems or any other downstream system.
In our scenario, this workflow is inserting the order records in the Azure SQL table using SQL connector as shown below
XML response of Transform XML action is being converted into JSON and then workflow is iterating through each order record and passing the values to Azure connector.
Summary
In this post we saw how to develop and EAI messaging scenario from the scratch by creating schemas and maps using visual studio and then uploading them to integration account and using them in Logic App work flow in integration account connectors.
Do you feel difficult to keep up to date on all the frequent updates and announcements in the Microsoft Integration platform?
Integration weekly update can be your solution. It’s a weekly update on the topics related to Integration – enterprise integration, robust & scalable messaging capabilities and Citizen Integration capabilities empowered by Microsoft platform to deliver value to the business.
If you want to receive these updates weekly, then don’t forget to Subscribe!
On-Premise Integration:
Cloud and Hybrid Integration:
Feedback
Hope this would be helpful. Please feel free to let me know your feedback on the Integration weekly series.
The Integration Account is part of the Logic Apps Enterprise Integration Pack (EIP) and is a secure, manageable and scalable container for the integration artifacts that we create. We can store maps, schemas, partners, agreements and certificates in our Integration Account once and reference them across all our logic apps making the creation of B2B processes with logic apps quick and easy.
Why should we use Enterprise Integration Pack?
we are able to store all our artifacts in one place, which is our integration account.
we can leverage the Logic Apps engine and all its connectors to build B2B workflows and integrate with 3rd party SaaS applications, on-premises apps as well as custom applications
we can also leverage Azure functions
In this blog, we will discuss how we can connect Azure Logic Apps with an Integration Account.
Use Case Scenario
Let’s assume organizations want to exchange messages electronically, even if they use different protocols and formats. the Enterprise Integration Pack enables you to transform different formats into a format that organizations’ systems can interpret and process. Organizations can exchange messages through industry-standard protocols, including AS2, X12, and EDIFACT. You can also secure messages with both encryption and digital signatures.
If you are familiar with BizTalk Server or Microsoft Azure BizTalk Services, the Enterprise Integration features are easy to use because most concepts are similar. One major difference is that Enterprise Integration Pack uses Integration Accounts to simplify the storage and management of artifacts used in B2B communications.
Create an Integration Account
In Azure Portal, and Click “+NEW” and choose “Enterprise Integration”. Select “Integration Account”.
In the Create Integration Account blade, enter the Name for our Integration Account, select the Subscription we want to use; either create a new Resource group or select an existing Resource Group, select a Location where our Integration Account will be hosted, select a Pricing tier, then click the Create button.
The process usually takes within 1 minute. Once the template has been provisioned, we will see a notification and the new instances and related resources will appear in the “Resource groups” section of the Microsoft Azure management console.
Add Maps
Integration Account uses maps to transform XML data between formats. A map is an XML document that defines the data in a document that should be transformed into another format.
Select the Maps tile.
After the Maps blade opens, choose Add. Next, Enter a Name for our map. To upload the map file, choose the folder icon on the right side of the Map text box. After the upload process completes, choose OK.
Add a schema file smaller than 2 MB
In the Schemas blade that opens (from the preceding steps), choose Add.
Enter a Name for our schema. Upload the schema file by selecting the folder icon next to the Schema box. After the upload process completes, select OK.
How to link an integration account to a Logic app
Note: We must ensure our Integration Account and Logic app are in the same Azure location.
Select the Integration Account under Setting from our Logic app, we wish to link to our Logic App from the Select an Integration Account drop down list box and click Save Button.
We will see a notification that indicates that our Integration Account has been linked to our Logic app and that all artifacts in our Integration Account are now available to our Logic App.
Adding XML Validation
Add a Request – When an HTTP request is received trigger our Logic App
Add the XML Validation action, choose Add an action
To filter all the actions to the one that we want, enter “xml” in the search box. Choose XML Validation
To specify the XML content that we want to validate, select CONTENT.
Select the body tag as the content that we want to validate.
Adding Transform XML
Add the Transform XML action by first selecting Add an action
Enter the word “transform” in the search box to filter all the actions to the one that we want to use
Select the Transform XML action
Add the XML CONTENT that you transform. We can use any XML data you receive in the HTTP request as the CONTENT. In this example, select the body of the HTTP request that triggered the Logic app
Select the name of the Map that you want to use to perform the transformation. The map must already be in our Integration Account. In an earlier step, we already gave our Logic App access to our Integration Account that contains our map
Adding Condition
Conditions are used to perform the action on which we add the condition when the condition matches the requirements.
Once the Logic App is configured, it should look as shown below.
Run the Logic App
To test the Logic App, we will use Postman to send a request (POST) with a payload.
Set content-type header to application/xml.
Set request body to the content of sample-order.xml.
On successful execution, the Logic App will respond with the transformed message (a SAP order) in response body.
Conclusion
Integration Account stores all our artifacts in one place and references them across all our Logic Apps, making the creation of B2B processes with Logic Apps quick and easy. This is great for ROI because previously created BizTalk artifacts like schemas and maps can be re-used.
Author: Kuppurasu Nagaraj
Kuppurasu Nagaraj is working as a Technical Trainer at BizTalk360. Microsoft Azure MVP. Having 7+ years of experience and his area of interest is Microsoft Azure, C#, ASP.NET, SQL Server etc. View all posts by Kuppurasu Nagaraj