Thursday, December 19, 2019

Registering a Microsoft Dynamics 365 Finance and Operations app with Azure Active Directory for OAuth 2.0 authentication (Integrations)


As we know D365FO implements Azure Active Directory based authentication for Web Services. Azure Active Directory Service provides identity as a service with support for industry-standard protocols. D365FO outsources authentication to Azure AD and any integration application like below should be registered app in Azure active directory and register the same in D365FO.
  • Recurring data batch job (Data management)
  • Recurring Integrations Scheduler (Used to upload file from  on premises to  D365FO using Data management(Local file share))
  • OData services
  • API’s ( Retail Server, CRT, OData services etc.. )
  • Customer web services

Getting started:-
To enable Microsoft Dynamics 365 Finance and Operations app access to external system then we must have the following:
·         Azure Active Directory account
·         D365FO account with Administrative permissions

How to do it...
First register a D365FO with Azure Active Directory in Azure portal:

1. In browser, Login to Azure Portal with Admin account (Preferably Dynamics 365 finance and operation Admin account which never expires) - https://portal.azure.com then click on “Azure active directory”

2. From the left-hand navigation toolbar, Under Manage section click on App registration and click on “New registration” to create new app.

3. In “Register an application” form, provide following info
Name: - <Can be anything friendly name>
Supported account types :( based on requirement, users can access from any AD)
Redirect URI: <it’s an optional parameter, you can give you D365FO URL as well>



4. Then Click on “View API permissions” to provide access to D365FO


5. Click on “Add a permissions”


6.  On the Request API permissions/Select an API page, select Dynamics ERP to grant the access.


7. Then click on “Delegate permissions” and provide access as based on your need: here I have given full access for all three, then click on Add permissions.
·         AX.FullAccess, 
·         CustomService.FullAccess
·         Odata.FullAccess.


7    8. Left side tool bar then click on “Certificate & secrets” under manage to generate secret key.


8    9. Click on “New client secret




      10. In “Add a client secret” form provide Description as you like and Expires as “Never”, so it will not be expired. Then click on “Add


     11. Please make a copy of newly created client secret value else will not be able to see once you leave the page.


      12. Once you registering D365FO application, then make a copy of the Application (client) ID as displayed in your application's overview page and secret key, as you will need to provide it during the authentication process.
Register the Newly created Azure Application with Dynamics 365 Finance and Operations
The Azure AD Application(s) created in the previous step need(s) to be granted access to the specific instance of D365FO.
Note:- This is required only if you are going to use service to service authentication type using secret key instead of user impersonation.
      1. In a web browser, navigate to Dynamics 365 Finance and Operations.
      2. Navigate to System Administration -> Setup -> Azure Active Directory applications and then click New.


      3. Enter the following values in their respective fields:
·         Client Id: <Application ID registered in Azure Active Directory, in previous steps>
·         Name: <Name for the application based on usage>
·         User ID: <Preferably service account user who has full access on D365FO>



How to verify...
After completing these steps, you should have this information recorded and available:
·         Application (client) ID
·         Client secret

We will use this information for authentication if you want to do CRUD operation in side D365FO from external applications.

Hope this helps, in another blog I will come up with how to make use of this authentication and import data using "Recurring Integrations Scheduler"

Monday, December 9, 2019

New feature - "Job history cleanup" batch job for Data management and other cleanup routines in Dynamics 365 for Finance and Operations

In this blog I would like to explain about the new batch job introduced in data management to clean up execution history and other list of clean up jobs which are available across modules in Dynamics 365 for Finance and Operations. 

Please check the list of clean up jobs in D365FO in Microsoft blog

And the most awaited clean up job has been released for Data management module (available in Platform update 29 and later), which is very important for most of the business as every business uses Data management (Integration, Data Migration or BYOD etc..) and this should be scheduled to clean up data regularly, else we end up with performance issues.

This “Job history cleanup” clears information from following tables.
    •   All STAGING TABLES
    •   DMFSTAGINGVALIDATIONLOG
    •   DMFSTAGINGEXECUTIONERRORS
    •   DMFSTAGINGLOGDETAIL
    •   DMFSTAGINGLOG
    •   DMFDEFINITIONGROUPEXECUTIONHISTORY
    •   DMFEXECUTION
    •   DMFDEFINITIONGROUPEXECUTION   
The functionality must be enabled in feature management and then can be accessed from Data management > Job history cleanup.


      1.     Please go All workspaces > Feature management and select “Execution history cleanup” and enable.



        2. Once we enable this feature then we should be able to see new tile called "Job history clean up" added to Data management module.








































This can be run as batch job with following parameters setting up.
  •   Number of days to retain history
  •   Number of hours to execute the job
  •   Recurring batch
For more information check Microsoft documentation.

Tags, 

#D365FO, #DataManagement, #CleanUp, #Clear, #DeleteExecutionHistory, #JobHistoryCleanup


Monday, December 2, 2019

Extending standard dataentity to add customized fields in Dynamics 365 finance and operation

This blog I will explain how can we extend standard entity to add our custom fields, Extensibility of standard data entity is indeed thing when we are implementing Dynamics 365 for Finance and Operations, and it is important to be able to have extensible data entities; else, we would have to write new data entities to be able to use a field we added to a standard table as an extension.
In this example, we will create an extension for the Customer entity, named CustCustomerV3Entity.
Getting started
Part of this recipe is to add an extension field so we can import data into it, so the first part is to create an extension for the CustTable table with a new field. This is optional, but is included in order to demonstrate how this is done.
To follow this optional step, create a table extension for the CustTable table and add a new field of type Title called JP_Title. Also, add this to a form extension so we can see the results.
We should know following objects before we start customizing:-
                 1. Target Table
            2.  Form name
            3.  Entity name
            4.  Staging table
How to do it...
Please follow below steps to create a data entity extensions:
     1)  Add your custom field in CustTable extension. Build your model.
     2)   Add this to a form extension of CustTable so we can see the results.
3)   And we can see the field on CustTable List page
4)   Create Data entity extension for CustCustomerV3Entity. You should see your field in the data source and add this new data source field in the entity field list’
5)   Add the same field in new table extension for CustCustomerV3Staging table
6)  Complete build & database synchronization.
7)    In D365FO UI, Go to System administration > workspaces > Data management > Framework parameters and select the tab Entity settings and click on Refresh entity list
       8)  Then go to System administration > workspaces > Data management > Data Entities, regenerate the mapping for CustCustomerV3Entity
     9)   Then we can see our newly added field mapping under the list.
How to verify...

We can verify this by adding CustCustomerV3Entity to excel and refresh the data and see the newly added field part of entity. For more information, please check the Open entity data in Excel when you start from Excel

Hope this helps and I will come up with another interesting blog post soon.

Tags,
#D365FO, #DataEntities, #Entity, #Extensions, #Standard , #DataEntity