Advertisements

Microsoft Flow – Export your flows and import them in Azure Logic Apps.

I really like Microsoft Flow, but I like  Azure Logic Apps better. Huh? Aren’t they the same or at least similar? Indeed they are similar, but I quite like having all my flows in a single place. and therefore I was pleasantly surprised  when I noticed the export to Logic Apps template option today:

 

So I exported my flow.  I went to Microsoft Azure Logic Apps and then I struggled to find and options. It’s not available when you try to create the logic app:

Also, if you first create the Logic App and then try to find an import option:

It is simply not there. then I had a look at the export file:

[code lang=text]
{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"parameters":{"logicAppName":{"type":"String","metadata":{"description":"Name of the logic app."}},"logicAppLocation":{"defaultValue":"[resourceGroup().location]","allowedValues":["eastasia","southeastasia","centralus","eastus","eastus2","westus","northcentralus","southcentralus","northeurope","westeurope","japanwest","japaneast","brazilsouth","australiaeast","australiasoutheast","southindia","centralindia","westindia","canadacentral","canadaeast","westcentralus","westus2","[resourceGroup().location]"],"type":"String","metadata":{"description":"Location of the logic app."}},"office365_Connection_Name":{"defaultValue":"office365","type":"String","metadata":{"description":"Name of the connection."}},"sharepointonline_Connection_Name":{"defaultValue":"sharepointonline","type":"String","metadata":{"description":"Name of the connection."}}},"resources":[{"type":"Microsoft.Logic/workflows","name":"[parameters('logicAppName')]","apiVersion":"2016-06-01","location":"[parameters('logicAppLocation')]","properties":{"state":"Disabled","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"}},"triggers":{"When_an_item_is_created":{"recurrence":{"interval":5,"frequency":"Minute"},"splitOn":"@triggerBody()?['value']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters('$connections')['sharepointonline']['connectionId']"}},"method":"get","path":"/datasets/@{encodeURIComponent(encodeURIComponent('https:/ /pieterveenstratriaddev.sharepoint.com/sites/CommSite'))}/tables/@{encodeURIComponent(encodeURIComponent('e42ebd6b-73a5-4b49-8886-e61515749c91'))}/onnewitems","authentication":"@parameters('$authentication')"}}},"actions":{"Send_an_email":{"runAfter":{"Send_approval_email":["Succeeded"]},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters('$connections')['office365']['connectionId']"}},"method":"post","path":"/Mail","body":{"To":"pieter@PieterVeenstraTriadDev.onmicrosoft.com;;","Subject":"Email ","Body":"Email sent"},"authentication":"@parameters('$authentication')"}},"Send_approval_email":{"runAfter":{},"type":"ApiConnectionWebhook","inputs":{"host":{"connection":{"name":"@parameters('$connections')['office365']['connectionId']"}},"path":"/approvalmail/$subscriptions","body":{"NotificationUrl":"@{listCallbackUrl()}","Message":{"To":"pieter@PieterVeenstraTriadDev.onmicrosoft.com;","Subject":"Approval Request","Options":"Approve, Reject","Importance":"Normal"}},"authentication":"@parameters('$authentication')"}}}},"parameters":{"$connections":{"value":{"office365":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'office365')]","connectionId":"[resourceId('Microsoft.Web/connections', parameters('office365_Connection_Name'))]","connectionName":"[parameters('office365_Connection_Name')]"},"sharepointonline":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sharepointonline')]","connectionId":"[resourceId('Microsoft.Web/connections', parameters('sharepointonline_Connection_Name'))]","connectionName":"[parameters('sharepointonline_Connection_Name')]"}}}}},"dependsOn":["[resourceId('Microsoft.Web/connections', parameters('office365_Connection_Name'))]","[resourceId('Microsoft.Web/connections', parameters('sharepointonline_Connection_Name'))]"]},{"type":"Microsoft.Web/connections","name":"[parameters('office365_Connection_Name')]","apiVersion":"2016-06-01","location":"[parameters('logicAppLocation')]","properties":{"api":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'office365')]"},"displayName":"[parameters('office365_Connection_Name')]"}},{"type":"Microsoft.Web/connections","name":"[parameters('sharepointonline_Connection_Name')]","apiVersion":"2016-06-01","location":"[parameters('logicAppLocation')]","properties":{"api":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sharepointonline')]"},"displayName":"[parameters('sharepointonline_Connection_Name')]"}}]}
[/code]

then I compared this with the Code view of an existing Logic App:

[code lang=text]
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {}
}
}
[/code]

Then I replaced the json following the definition part ( Microsoft, was it really not possibly to include the “definition”: { } in the export file? But as soon as I hit the save button I got the following error message:

Failed to save the logic app. Unrecognised schema version.

I’m not going to be beaten that easily. As I tried to fix template I moved from one error into the next and I wasn’t really getting anywhere.

Next approach, create a new app in Azure Logic Apps and then check the code view and see what I did wrong earlier

This is where you will quite quickly make the conclusion that the export option doesn’t really deliver the right format json.  Yes you could create a Logic app and then copy in the actions with the code view, but this will probably take longer than creating the actions manually.

Advertisements

3 thoughts on “Microsoft Flow – Export your flows and import them in Azure Logic Apps.

    1. Hi Jeff, not completely as I’m also looking at the copying snippets from the export file. This is currently the best option available. If you are looking for a straight forward export/import then indeed we will still have to wait a while.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: