Some time back we looked at creating Azure Logic Apps for cloud integrations. In this post, we will look at how to create an Azure Logic App that performs Common Data Service functions based on Common Data Service events. We will create an Azure Logic App that, when an account is created in Dynamics 365 / Power Apps, we will also create a contact and assign that contact to the new account. Let’s do it.
Log into https://portal.azure.com/ and search for Logic Apps:
Click Add to create a new Logic App:
Give the App a name and resource group, and click Create:
Click on Logic App Designer:
Click on Blank Logic App:
Search for and select Common Data Service:
We will trigger our app to run when a record is created in the Common Data Service. Select When a record is created:
You will see:
Select your Org, entity = Accounts, and the scope, e.g. Organization:
We now need to do something when the account is created. Add a step, and let’s select the Common Data Service connector again:
Select Create a new record:
Let’s create a simple contact with last name = NEW. Set the Company Name to the Account, and the Company Name Type to accounts:
Save the Logic App:
Now let’s test this. Create a new account in your Dynamics 365 / Power App. After a few moments, refresh and we see the contact has been created and assigned to the new Account:
So we know our Logic App has run. Now let’s look at it in the Azure portal. Under Metrics, we see the Logic App has run:
We can also select Diagnostics to see more data:
And we can select Runs History to see details on each run, showing successes and failures:
Selecting a record will show the Logic App flow and where exactly it succeeded and failed, and we can troubleshoot any issues from here:
Very easy to set up cloud integrations using Azure Logic Apps using the Common Data Service connector.
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
Hye Carl. Thanks for your post. I am working with logic apps and cds. One question i had was around durability. It seems like cds does not store events. For example, if i turn off the logic app or deploy a new version, while it is not running I lose messages. Can you suggest a way around this? We have had to revert to usng CRM publisher plugin to publish events to a service bus to overcome.
Hi Carl, I have a query about this. The Logic App subscribes on events but it is not transaction aware as it is an external component. The Logic App will trigger on all the events but what will happen if the transaction rolls back in Dataverse? The event has already been triggered and served by the Logic App anyway and that data will be invalid. What do you think? Have you tried that scenario?
Unfortunately, it does not work if you are trying to read from Audit table, because there is no scope.