Showing posts with label Integration. Show all posts
Showing posts with label Integration. Show all posts

Tuesday, June 28, 2022

D365 FO Create Custom Web Service

 How to create basic custom Web Service in D365FO.

1- Create a class with name of IntegrationService  and write a method Test.


2  Add new Service and associate your class.



 

3- Add method of your class in service operations node you want to expose.



4- Add Service group and associate your service with the service group. 


A - Set the service property Auto deploy= YES


B- Add service to Service Group



5- Perform Build & Sync and verify from browser.

Service URL 
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/[ServiceGroupName]/[ServiceName]/[MethodName]

Sample
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/IntegrationServiceGroup/IntegrationService/Test



Monday, June 27, 2022

D365 FO Azure App Registration

 

To register a new application using the Azure portal

1.  Sign in to the Azure portal. 

2 - Go To Manage Azure Active Directory



3- In the left-hand navigation pane, 
Click App registrations, 
click New application registration.

 


 

4 - Enter Name for App Registration and Choose Supported Account Type

 

The application will visible like the below screenshot after creating the process completely .

You will find ( Client ID , Tenant ID .. etc)


 5- Application Owner

Add only if you want to make someone an owner. Otherwise, skip the steps.




 6- Application Permission

Below is the permission which is required to activate.




 

  

Following are the further detail of each permission. Please check the below screenshot.

 

7- Keys

For Web API we need a secret key with the help of this key client will get the Authentication.

After generation of the key, please save the key because it will not visible again to you.


Please follow Link to use Dynamics 365 Finance & Operation WebAPI with POST MAN


 

 

D365 Finance & Operation Web Service with POST MAN

 

Dynamics 365 Finance & Operation WebAPI with POST MAN


Dynamics 365 Finance & Operation WebAPI with POSTMAN


Most of the time we used 3rd Party tools like fiddler, Post Man and SoupUI as clients to consume web services.

In this blog i will explain, How can we use POSTMAN to consume Web-API by using Oauth2 Azure Authentication.


1 Download the POSTMAN from this link.

2 Register The Azure Application (Web API). You can follow this link
 
3 Once App registration completed Enter Application ID in D365FO










4 Open POST man and navigate to Authorization Tab and select OAuth2 as Authentication Type.

Reference screenshot





5 Click on Get New Access Token. A Popup will appear.








6 Fill the required fields Like below

Call Back URL > You can't change this.
Token Name (As per your requirement)
Auth URL

https://login.windows.net/YourTenant.com/oauth2/authorize?resource=https://EnvironmentURL.operations.dynamics.com

Access Token URL
https://login.windows.net/YourTenant.com/oauth2/token?resource=https://EnvironmentURL.operations.dynamics.com

You can find the tenant from AX as well. Open D365FO Click on the Setting icon. you can find it the on the top right of the screen then click on about.







Client ID > Application ID You Registered On Azure Portal
Secret Key > Enter the secret key you generate against your Azure Application.







7 If you don't provide a secret key then a popup window will appear for login.


 



8 Click on Request Toke. Within 4 to 5 seconds you will get the Azure Authentication Token.

9  Now select the Header value from the drop-down and click on USE token to add this token in your request.




10 Navigate to Header Tabs for the verification of the Authorization token in your request



11- Enter the Complete service URL and click on send. in my case, I have called test2 service.

Service URL 
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/[ServiceGroupName]/[ServiceName]/[MethodName]

Sample
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/IntegrationGroup/IntegrationService/test2 





Please check the above screenshot. You will find the successful result