CI/CD pipeline for Azure LogicApps Integration account Using AzureDevOps
CI/CD pipeline for Azure LogicApps Integration account Using AzureDevOps
Logic Apps is a cloud-based platform that helps you create and run automated workflows for integrating apps, data, services, and systems. Using this platform, you can more easily and quickly build highly scalable integration solutions for enterprise and business-to-business (B2B) scenarios.
The Integration account acts as a container for storing Schemas, Maps and Assemblies. Using these artifacts allows for richer transformations, such as XML to CSV, B2B Electronic Data Interchange or complex data mappings that involve large enterprise systems like SAP.
The process for using the Integration account is as follows. We will walk through this process in this post.
Azure Integration Account comes with lot of options
- Schemas
- Maps
- Assemblies
- Certificates
- Partners
- Agreements
- Batch Configurations
- RosettaNet PIP
For more information about individual components, please find the url’s.
Create or manage B2B integration accounts - Azure Logic Apps
Before you can build enterprise integration and B2B solutions by using Azure Logic Apps, you need to create an…
docs.microsoft.com
Problem statement:
As most of the developers will be working on many items such as “Schemas”, “maps”, “assemblies” etc and at some point of time it needs to be deployed/Uploaded to Azure Integration account very frequently.
So How do I do that ? → And that's the place AzureDevOps pipelines comes handy.
So lets look into our AzureDevOps pipeline.
Build Stage
Step 1 — Creating the Logic App Integration account infrastructure ARM template
In this template we add Azure Integration account :
- Define the ARM template to deploy the Logic App Integration account.
- Define Parameters in parameters.json file.
you can find sample Template and Parameter.json files at:
azure-quickstart-templates/quickstarts/microsoft.logic at master · Azure/azure-quickstart-templates
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…
github.com
Step 2 — Copy and create Build Artifact(s).
In AzureDevOps pipeline I am going to use 2 tasks.
- Copy files
- Publish Artifact: to drop
Generated artifact.
Deployment stage
I am going to use AzureDevOps pipeline to deploy Schema’s, Liquid files, Maps etc.
Step1: Create a new release pipeline and add “IntegrationAccount” build artifact.
Step2: Add 3 tasks in your release pipeline.
- Integration Account: Use Azure Resource group deployment task, Provide Template and Parameter json file path.
- Schema Update: For Schema update I am going to use simple PowerShell script which will pick all recently added .xsd files
$AccountName = “AzureIntegrationAccountName”
$ResourceGroupName = “AzureResourceGroupName”
$ResourceGroupLocation = “East US”
Import-Module Az.LogicApp -Force -ErrorAction SilentlyContinue
$schemasFolder = “$(System.DefaultWorkingDirectory)/_LogicApps-Integration-account/drop/artifacts/Schemas”
$schemas = @(Get-ChildItem $schemasFolder -Filter *.xsd)
foreach ($schema in $schemas)
{
$schemaFilePath = $schema.FullName
$schemaName = $schema.BaseName
$schemaContents = [IO.File]::ReadAllText($schemaFilePath)
$PropertiesObject = @{
schemaType = “Xml”
content = “$schemaContents”
contentType = “application/xml”
}
$schema = get-azintegrationaccountschema -name “AzureIntegrationAccountName” -resourcegroupname “AzureResourceGroupName” -SchemaName $schemaName -ErrorAction SilentlyContinue
if ($schema)
{
# Update the schema
Write-Host “Updating schema $schemaName in IntegrationAccount $AccountName in ResourceGroup $ResourceGroupName”
Set-AzResource -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Logic/integrationAccounts/schemas -ResourceName “$AccountName/$schemaName” -ApiVersion 2016–06–01 -Force
}
else
{
# Create the schema
New-AzResource -Location $ResourceGroupLocation -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Logic/integrationAccounts/schemas -ResourceName “$AccountName/$schemaName” -ApiVersion 2016–06–01 -Force
}
}
- Liquid files Update: For Liquid files update I am going to use similar PowerShell script which will pick all recently added .xslt files
Lets use the same PowerShell script method to upload liquid map files.
$AccountName = “AzureIntegrationAccountName”
$ResourceGroupName = “AzureResourceGroupName”
$ResourceGroupLocation = “East US”
Import-Module Az.LogicApp -Force -ErrorAction SilentlyContinue
$mapFolder = “$(System.DefaultWorkingDirectory)/_LogicApps-Integration-account/drop/artifacts/XSLT”
$maps = @(Get-ChildItem $mapFolder -Filter *.xslt)
foreach ($map in $maps)
{
$mapFilePath = $map.FullName
$mapName = $map.BaseName
$mapContents = [IO.File]::ReadAllText($mapFilePath)
$PropertiesObject = @{
mapType = “Xslt”
content = “$mapContents”
contentType = “application/xml”
}
$map = Get-AzIntegrationAccountMap -Name “AzureIntegrationAccountName” -ResourceGroupName “AzureResourceGroupName” -MapName $mapName -ErrorAction SilentlyContinue
if ($map)
{
# Update the map
Write-Host “Updating map $mapName in IntegrationAccount $AccountName in ResourceGroup $ResourceGroupName”
Set-AzResource -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Logic/integrationAccounts/maps -ResourceName “$AccountName/$mapName” -ApiVersion 2016–06–01 -Force
}
else
{
# Create the map
New-AzResource -Location $ResourceGroupLocation -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Logic/integrationAccounts/maps -ResourceName “$AccountName/$mapName” -ApiVersion 2016–06–01 -Force
}
}
You can find more information about Schema’s/Maps/Liquid files/Assemblies further at below links:
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-certificates
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language