Skip to content

How To guide

Jack Duan [SSW] edited this page Jul 14, 2022 · 5 revisions

How to connect to d365 using PostMan

Many of my collegues include myself are strugling retrieving data from d365. As a result, I create a Postman collection to make this process easier.

Add space to post man

Follow the flow chart to import from the postman Json link.

Note : the flow chart might be broken, it is GitHub problem, and they promise that they will fix it ASAP, please delete this note once the issue has been fixed

flowchart LR;
    A[Click Import button]-->B[Click link]-->C[Enter Json link]-->D[Click continue]-->E[Choose the collection and put it into your Postman];
Loading

Figure: FlowChart for importing collection

image Figure: ScreenShot for importing collection

The Json link is: https://www.getpostman.com/collections/7ddaa3c280323021d0a2

Get token using OAuth 2.0

Once you have imported the space from Json URL, follow the below steps:

  1. Click the request 'GetSkill'
  2. Click Authoriztion
  3. scroll down to the bottom and click button 'Get New Access Token'
  4. Scroll down to find drop box 'Grant Type' and choose 'Implicit'
  5. Input '{{callback}}' into the box 'Callback URL' image Figure: Get OAuth Token
  6. Input your credentials in the redirect web page
  7. Click 'Use Token' button

image

Figure: Use OAuth Token

Now you are ready to go, try to make HTTP request with the Token!

How to sync to LUIS during runtime

There are always new people join our team, so we need a way to sync the newly added data to LUIS without re-deploy the LUIS application. In this how-to tutorial, We will show you how to sync data to LUIS.

Infrustracture Diagram

We are using pub/sub pattern to sync data from d365 to LUIS. The infrustracture diagram is shown blow.

Azure Function

Azure function is triggered whenever a sync message is sent to the service bus.After recieving messages from service but, we are using LUIS C# SDK to sync data to LUIS. For more infomation, you can refer to Azure function and DI Code example.

Azure service bus

Azure service bus is the message broker of the sync service. You can refer the official documentation to set it up. Once you set it up, you need to modify the appsetting.json file to connect Azure function to the Service Bus.

Power Automate Flow

Power Automate flow is triggered daily to sync the employee data and send the updated employee data to the Azure Service bus.