Convert Your Common Data Service Power Automate Flows to Run as Azure Logic Apps

Leave a comment

Imagine a situation where you have created a Power Automate Flow, and you want to convert it to an Azure Logic App so you can take advantage of the Azure Logic App features. Let’s look at how to do this with a Common Data Service example. There are a couple of “gotchas” we will note.

First, let’s create a simple Power Automate Flow. Our flow will do the following – when an account is created in the Common Data Service (e.g. through Dynamics 365 / Power Apps), create a new Contact and associate that contact with the account just created.

Go to https://flow.microsoft.com and create a new Automated – from blank flow:

Find the Common Data Service – When a record is created:

The flow looks like below – it’s pretty simple. Note I’m selecting the actual environment here, not (Current):

On running this by creating a new account in Dynamics 365 / Power Apps, we see the contact is created too:

Now let’s export this to Azure Logic Apps. In Power Automate, for this flow select Export->Logic Apps Template (.json):

This downloads the .json file:

Which looks something like:

Log into Azure portal at https://portal.azure.com/ and create a new resource:

Search for template deployment:

And select Template deployment (deploy using custom templates):

Click Create:

Select Build your own template in the editor:

Click Load File:

Select the JSON file previously downloaded from Flow. It will load like below. Click Save:

Enter any required fields and give the Logic App a name. Note, be sure to not have spaces in the name, or you will end up with the error “Deployment to resource group ‘yourresourcehgroup’ failed.
Additional details from the underlying API that might be helpful: At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.”, which can produce the message “The provided workflow name ‘Contact create’ has these invalid characters ‘ ‘. The name can only be a letter, digit, ‘-‘, ‘.’, ‘(‘, ‘)’ or ‘_’.”.

Once confirmed, click Purchase:

Once complete you will see a confirmation message that the Azure Logic App has been deployed. Browse out to Logic Apps and select the new app:

 

Click on the Logic App Designer. We see the flow looks the same as from Power Automate:

Click on Parameters in the toolbar. We see there is one $authentication parameter. Click to delete it:

Then click Enable on the new Logic App:

Before you do anything else, disable the original Power Automate flow.

Let’s test it out. Create an Account in Dynamics 365 / Power Apps. We see our contact is created:

And in our Logic App, we see we have one “succeeded”:

Selecting Diagnostic Settings, we our successful call from Dynamics 365 / Power Apps:

That’s it, your Power Automate flow is running as an Azure Logic App.

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *