AX 7. Azure Logic Apps, CDM and PowerApps. Part 1.

We are all exited with Dynamics365 coming. As we know, it is based on PowerApps, Common Data Model and Flow. Finally, we can put all these features together with connector to AX online which is released recently (https://flow.microsoft.com/en-us/blog/more-september-updates/).

Today, I will show how Azure Logic Apps can be used in integration scenarios. For example, we want to create a new customer in AX from an external web service. In previous versions it was non-trivial task, but now it could be done in couple of clicks!

First of all, we need to create a new Logic App. We can do this either from Visual Studio or directly from Azure portal.

This app will receive requests from external web services and to handle this we will add HTTP request trigger that accepts JSON.

httprequestrigger

To build JSON schema you can use one of dozens online services. Here is example from one of them:

jsonshemabuild

As you can see, my request contains AccountNum, DataAreaId, CurrencyCode, CustomerGroupId, name and AddressCountryRegionId fields.

On the next step we will add Dynamics AX connector that uses values from JSON request to create new customer. After specifying connection to AX 7, you can select any OData entity from drop down list and it will automatically add all mandatory fields. Each filed you can map with value from JSON simply selecting them from a list.

dynamicsaxconnection

That’s all, save it and we can start testing.

To send the request I used Postman, but in real life scenario it would be a web service.

postman

Voila! New customer has been created in AX.

newcustomer

On Azure portal you can track execution status and debug into each step, where you can see all data that was sent.

execution-status

execution-status

What’s next? You can add a response to notify web service if record was successfully created, send email with confirmation or even SMS.

In my next post I’m going to look at CDM and PowerApps, stay tuned!

Advertisements

7 thoughts on “AX 7. Azure Logic Apps, CDM and PowerApps. Part 1.

  1. Krishna R Alaparthi November 16, 2016 / 1:15 pm

    I am not able to see Dynamics AX Connector.. Any insights ?

    • ievgensaxblog November 16, 2016 / 7:17 pm

      Hey Krishna,
      You cannot start your FLow or Logic app from Dynamics AX connector now, you should have trigger to trigger it. In my example I have request that will trigger creation of a record, but it could be something else CRM, twitter, or email.

      • Krishna R Alaparthi November 30, 2016 / 1:05 pm

        Thank you Ievgen. I can see the Dynamics 365 for Operations connector now. I am trying to use “Get Records” trigger. Unfortunately, after providing the instance name, the Entity Name combo is not getting populated and throwing error “Could not retrieve values. error executing the api /datasets/https%3A%2F%2Fax72newdevaos.cloudax.dynamics.com/tables”. Any idea what’s wrong?

  2. Sunil December 14, 2016 / 4:38 pm

    Hi Ievgen,

    Thanks for sharing….i’m trying flow using Dynamics 365 operations but my flow gives error..
    Trying CRM Accounts to AX customers entities. gives below error.

    { “status”: 401, “message”: “{\r\n \”Message\”: \”Authentication failed.\”,\r\n \”StackTrace\”: null,\r\n \”ExceptionType\”: \”System.InvalidOperationException\”\r\n}”, “source”: “xxx.cloudax.dynamics.com”, “errors”: [] }

    It seems authentication fail, what steps need to follow/ how to configure trigger (Dynamics ax) to consume CRM data entities. Thanks for your help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s