Logic Apps deployment template extractor updates june

Another update to the Logic App Template Extractor has come out, read more about the Logic App Tmplate Extractor in the earlier post Logic Apps Deployment Template Extractor

This update focus on Usage of Integration Acount actions and the standard HTTP action. With this update it’s easier to create a standard template for multiple flows, we often see the same patterns again again and again. This update makes it easy to create a standrad flatfile, XML Transform pattern that is resuable in multiple flows with just diffrent parameter files.

Flat File Decode and Encode

Flatfile actions Decode and Encode conatins a schema property it contains the name of the schema and this is something that is extract automatically as a property to easily be set via a property file.

And in the extracted ARM template we will automatically get:

"parameters": {
...
  "Flat_File_Decoding-SchemaName": {
      "type": "string",
      "defaultValue": "INT0021.SystemA.DailyStatistics"
    },
    "Flat_File_Encoding-SchemaName": {
      "type": "string",
      "defaultValue": "INT0021.SystemB.DailyStatistics"
    }
...
  "actions": {
    "Flat_File_Decoding": {
      "runAfter": {},
      "type": "FlatFileDecoding",
      "inputs": {
        "content": "@{triggerBody()}",
        "integrationAccount": {
          "schema": {
            "name": "[parameters('Flat_File_Decoding-SchemaName')]"
          }
        }
      }
    },
    "Flat_File_Encoding": {
      "runAfter": {
        "Transform_XML": [
          "Succeeded"
        ]
      },
      "type": "FlatFileEncoding",
      "inputs": {
        "content": "@{body('Transform_XML')}",
        "integrationAccount": {
          "schema": {
            "name": "[parameters('Flat_File_Encoding-SchemaName')]"
          }
        }
      }
    },

XML Transform

The XML Transform contains a map property this is the name of the map, this is something that is extract automatically as a property to easily be set via a property file.

And in the extracted ARM template we will automatically get:

"parameters": {
...
 "Transform_XML-MapName": {
  "type": "string",
  "defaultValue": "INT0021.DailyStatistics.SystemA.To.SystemB"
 }
...
  "actions": {
  	....
    ,
    "Transform_XML": {
      "runAfter": {
        "Flat_File_Decoding": [
          "Succeeded"
        ]
      },
      "type": "Xslt",
      "inputs": {
        "content": "@{body('Flat_File_Decoding')}",
        "integrationAccount": {
          "map": {
            "name": "[parameters('Transform_XML-MapName')]"
          }
        }
      }
    }

Http

The HTTP action is videly used and common in all types of setups, normaly when moving from Dev to Test involves changes to both the URI nad authentication parameters. Now these are moved as ARM template properties to make it easier to deploy changes between environments.

The basic case, promoting the URI

"parameters": {
...
 "HTTP-URI": {
  "type": "string",
  "defaultValue": "http://google.se"
 }
...
	"HTTP": {
	  "type": "Http",
	  "inputs": {	   
	    "body": {
	      "test": "data"
	    },
	    "method": "POST",
	    "uri": "[parameters('HTTP-URI')]"
	  },
	  "conditions": []
	} 
 

Later on you will probobly use some sort of authentication and the extractor will push these to ARM templates aswell.

Http Basic Authentication

"parameters": {
...
 "HTTP-URI": {
  "type": "string",
  "defaultValue": "http://google.se"
 },
 "HTTP-Password": {
  "type": "string",
  "defaultValue": "myusername"
 },
 "HTTP-Username": {
  "type": "string",
  "defaultValue": "mypassword"
 }
...
	"HTTP": {
	  "type": "Http",
	  "inputs": {
	  	"authentication": {
          "password": "[parameters('HTTP-Password')]",
          "type": "Basic",
          "username": "[parameters('HTTP-Username')]"
        },	   
	    "body": {
	      "test": "data"
	    },
	    "method": "POST",
	    "uri": "[parameters('HTTP-URI')]"
	  },
	  "conditions": []
	} 

Http Client Certificate Authentication

"parameters": {
...
 "HTTP-URI": {
  "type": "string",
  "defaultValue": "http://google.se"
 },
 "HTTP-Password": {
  "type": "string",
  "defaultValue": "myusername"
 },
 "HTTP-Pfx": {
  "type": "string",
  "defaultValue": "mypfx"
 }
...
	"HTTP": {
	  "type": "Http",
	  "inputs": {	   
	  	"authentication": {
          "password": "[parameters('HTTP-Password')]",
          "pfx": "[parameters('HTTP-Pfx')]",
          "type": "ClientCertificate"
        },
	    "body": {
	      "test": "data"
	    },
	    "method": "POST",
	    "uri": "[parameters('HTTP-URI')]"
	  },
	  "conditions": []
	} 

Http Active Directory OAuth

"parameters": {
...
 "HTTP-URI": {
  "type": "string",
  "defaultValue": "http://google.se"
 },
 "HTTP-Audience": {
  "type": "string",
  "defaultValue": "myaudience"
 },
 "HTTP-Authority": {
  "type": "string",
  "defaultValue": "https://login.microsoft.com/my"
 },
 "HTTP-ClientId": {
  "type": "string",
  "defaultValue": "myclientid"
 },
 "HTTP-Secret": {
  "type": "string",
  "defaultValue": "https://login.microsoft.com/my"
 },
 "HTTP-Tenant": {
  "type": "string",
  "defaultValue": "mytenant"
 },
...
	"HTTP": {
	  "type": "Http",
	  "inputs": {
	  	"authentication": {
          "audience": "[parameters('HTTP-Audience')]",
          "authority": "[parameters('HTTP-Authority')]",
          "clientId": "[parameters('HTTP-ClientId')]",
          "secret": "[parameters('HTTP-Secret')]",
          "tenant": "[parameters('HTTP-Tenant')]",
          "type": "ActiveDirectoryOAuth"
        },	   
	    "body": {
	      "test": "data"
	    },
	    "method": "POST",
	    "uri": "[parameters('HTTP-URI')]"
	  },
	  "conditions": []
	} 

Tools like the Logic App Template Creator helps us focus on the fun and good parts, building great solutions for our customers.

I strongly recomend you to try it and help out evolving it, more updates coming so stay tuned!

https://github.com/jeffhollan/LogicAppTemplateCreator

Posted in: •Logic Apps  •Integration  | Tagged: •DTAP  •Logic Apps  •Deployments  •Azure  •ARM  •ARM Template