Installation
    • 25 Nov 2024
    • 10 Minutes to read
    • Contributors
    • PDF

    Installation

    • PDF

    Article summary

    Prerequisites

    Before the Lasernet CE Connector can be installed, several prerequisite steps need to be completed. Firstly, we need all the component parts of the solution:

    • An FO environment with the Lasernet FO connector properly installed and configured (see the Lasernet FO Connector Installation Guide).

    • A  properly installed Lasernet instance that is configured and connected to the FO instance.

    • A CE environment in which to install the connector.

    As part of the installation process, we will need the following access (these may all be the same user or multiple users, depending on your organization):

    • A user with system admin access in the CE and FO environments.

    • A user with access to deploy a package to the CE environment.

    • A user with access to Azure to create an App Registration.

    • A user with access to the Power Platform Admin Centre to create a CE Application User.

    • A user with Tenant Admin access to approve App Registrations.

    Once the environments and access are confirmed, we also need the following solution components:

    • A copy of the CE Connector package, the latest version can be found here: Download Latest Releases (take the latest version of the Lasernet CE Connector).

    • A license for the CE Connector package.

    • Test data in both systems - this is not crucial but makes the process easier.

    Deploy the Lasernet CE Connector Package

    The first step in installing the Lasernet CE Connector is to deploy the package from Lasernet into the appropriate CE environment. There are a number of ways to do this, if in doubt refer to the latest Microsoft documentation or check with your CE partner. In this example we will be deploying the solution through make.powerapps.com.

    1. Within Powerapps, ensure that you are in the correct environment, this should be the environment where you want to deploy the CE Connector package.

    1. Once you have confirmed that you are in the correct environment, navigate to Solutions.

    1. Click Import solution.

    1. In the pane that pops up, select Browse.

    1. Browse to the location where you saved the Lasernet CE Connector package and select it. The original download is a zip file, so you need to extract it.

    1. Select the Lasernet_1_1_0_0_DynCE file and click Next to load the solution.

    2. Once the downloaded folder is extracted, select the CE installation package, click Next and load the solution.

    1. The system will show a preview of what is being imported, check that it matches and then click Import.

    Powerapps will import the solution.

    Once complete, the Lasernet package is displayed in the list of available solutions:

    The Lasernet options will also be available to select from within the advanced settings in your CE environment.

    Create Azure App Registration

    Now that the package is deployed, it is necessary to create the mechanism for communication between FO and CE, which is the App Registration.

    There are three parts to this:

    • Creating the registration and copying the IDs.

    • Confirming the correct settings.

    • Setting up the user impersonation.

    Firstly, to create the App Registration and generate the required IDs, follow these steps:

    1. Navigate to http://portal.azure.com and in the search bar type ”app registrations”, then open the App registrations resource that is displayed:

    1. On the form which is displayed, click New registration.

    1. Give the new app registration a sensible name.

    1. If your FO and CE instances are within the same tenant, select the first option under Supported account types. If they are within different tenants, select the second (if unsure select the first, most will be within the same tenant).

    1. Select Web as the platform type, then copy your FO URL into the box.

    1. Click Register.

    The following screen is displayed:

    1. Using the Copy to clipboard button, copy the Application Client ID and save it somewhere to use later. Notepad or a Word document are ideal for this.

    1. Create a new client secret by clicking the Certificates and secrets menu item, then click New client secret.

    1. Select when the secret expires. Azure will send a notification before the secret expires to let you know that it needs updating soon.

    1. Click Create, and when the client secret is displayed, use the Copy to clipboard option to copy it to the same place where the application ID was copied earlier.

    Note

    Once copied, the secret will never be displayed again in Azure, so be sure to copy it somewhere safe. If you lose the secret, you will need to create a new one.

    App Registration Configuration

    Next, complete the required configuration on the App registration by following these steps:

    1. Navigate to the Authentication tab and ensure that both of the boxes are selected as shown:

    1. Depending on your organisation's Azure setup, it may be necessary to update the Who can use this application.... options to multitenant rather than single tenant. If your FO and CE instances are in the same tenant, this can stay as Single tenant. If they are in different tenants, update this to Multi tenant. If unsure, contact your CE partner.

    User Impersonation Setup

    With the required configuration of the App Registration is done, the user impersonation setup remains to be completed.

    1. Navigate to API Permissions and click Add a permission.

    1. Select Dynamics CRM from the options.

    1. Ensure the checkbox for user_impersonation is selected.

    1. Click Add permissions and the setup for the App registration is complete.

    Create Connection in Finance and Operations

    To create the connection in FO which will link FO to CE, follow these steps:

    1. Open the FO environment that will be connected to CE, and select the entity from within FO which you want to connect to CE.

    Note

    The Lasernet CE Connector configuration is entity specific.

    1. When in the correct environment and the correct entity, navigate to Lasernet > Dataverse/Dynamics365 > Lasernet Dataverse/Dynamics 365 Setup.

    1. On the screen that is displayed, click New.

    1. Give the connection a sensible name, here it is named the same as the CE environment which is being connected, but your organisation may already have a naming convention for this.

    On the new connection, there are empty spaces which will need to be filled in with information to connect this FO instance to CE.

    1. Add the Client ID and the Client Secret which were copied from the App registration.

    1. The Client ID gets copied twice, into both of the Client ID boxes, after copying into the first box, the following popup will be displayed, click Yes.

    1. Copy the Client ID into the second box, and then the client secret into the Client Secret box as shown.

    2. Click Save.

    Set Up Application Users in FO and CE

    To create the users in FO and in CE that will act on behalf of the App Registration, follow these steps:

    1. In FO, navigate to the connection screen through Lasernet > Dataverse/Dynamics365 > Lasernet Dataverse/Dynamics 365 Setup, select the connection that was created in the previous step and then click Tools.

    1. Under Tools select Manage client ids.

    1. Select the client ID that matches the ID which was just copied into the connection, and assign it a sensible name.

    1. Next, the ID needs to be assigned a user whose default company is the same as the entity in which the CE connection is configured. In this example the user which is assigned the ID is Admin.

    The Admin user Company is set to DAT, but the CE connection that is being configured here is in USRT so either the Admin user company needs to be changed, or a different user needs to be selected.

    Note

    It is recommended that the user referenced by the Client ID is not a user linked to an actual person, but rather a user created specifically for this application. In this instance a new "CEApplicationUser" user has been created and given System Admin access (this can later be restricted based on which requirements are identified) and assigned to the USRT company.

    This user is then assigned the Client ID, and the form is saved.

    Create the Application User for CE

    To create the Application User for CE, follow these steps:

    1. Navigate to https://admin.powerplatform.microsoft.com/, then select Environments.

    1. Select the CE environment that needs to be connected to FO.

    1. Click See all to display the list of users.

    1. Navigate to the App users list.

    1. Click New App User.

    1. Click Add an app.

    1. On the list page that is displayed, search for the Application ID from the App Registration used earlier, select it and click Add.

    1. Select the Business Unit (if there is more than one, then check with your CE partner which one is correct).

    1. Assign the Application User the Lasernet Admin, Lasernet User and System Administrator roles. These can be adjusted at a later date to restrict access.

    1. Click Create.

    Complete the Connection Setup in FO

    Update the API URL

    To update the API URL, navigate to Lasernet > Dataverse/Dynamics365 > Lasernet Dataverse/Dynamics 365 Setup, in FO.

    To get this API URL, follow these steps:

    1. Navigate to the CE environment that is being connected to FO, click the Settings cog and select Advanced settings.

    1. Click the down arrow next to Settings to open the Menu Options.

    1. On the tab that opens, navigate to Settings > Customization > Customizations.

    1. Navigate to Developer Resources.

    1. Copy the Service root URL and paste it into the API URL field in the FO connection.

    1. Click Save.

    Confirmation of Instance Connection

    To confirm that the instances are connected, follow these steps:

    1. Expand the optional tab at the bottom of the connection form and see that it is empty.

    1. Under Tools, click Lookup Dataverse instance.

    1. Click Fetch Dataverse/Dynamics 365 Instances.

    1. Accept the conditions in the popup.

    An error will be shown because the user is not logged in - this is expected.

    1. Click the Fetch Dataverse/Dynamics 365 instances button again and log in.

    2. From the list which is displayed, highlight the CE environment which is being connected, and click Select.

    The information at the bottom of the connection form has now been updated with the correct information from the CE environment.

    Consent for the App Registration

    To complete the connection setup, it is necessary to run consent for the App Registration. Follow these steps:

    1. From within the connection form, navigate to Tools, and then under Consent (ADAL).

    1. Select Run D365FO consent and you will be prompted to log in with a Tenant Admin User who can consent to the App Registration between the two environments. Do the same for the Run Dataverse/Dynamics 365 Consent underneath.

    Once this is complete, a message will be shown on the screen that validation was successful and the API Permissions on the App Registration will also be updated to show that the status of the User Impersonation permission is granted.

    Which Connection Should FO Use?

    To let FO know when to use the connection, follow these steps (in this example, we only use one connection):

    1. Navigate to Lasernet > Setup > Administration and select Connections.

    1. Click New.

    1. Give the new connection a sensible name, in this instance it has been named the same as the CE organisation which it is connected to.

    2. Under Connection Type select the Dataverse/Dynamics365 connection type.

    1. Click Save, and then select the Instance Name from the drop down which is shown; this instance name should match the name of the connection which was created in previous steps.

    1. Click Save and the connection will be validated.

    Validate the Connection

    To validate the connection, create a dummy class report. To do this, follow these steps:

    1. Navigate to Lasernet > Common > Reports.

    1. Click New, set the Report Name to Test, set the Origin to Class and toggle the Active button to Yes.

    1. Once this is saved, navigate to the Archive tab, under Archive, select Default , under Destinations To Archive select All Destinations and toggle the Save XML button to Yes.

    1. Navigate to Setup > Query wizard.

    1. Click Next on the first screen that is displayed, then select your connection from the drop down.

    1. Click Next again and now it is possible to see a list of Entities - this shows that our FO environment is connected to our CE environment because it can see all the entities in the CE environment. This includes any custom entities which may have been created. In order to test this further, select an Entity from the list - this is where having test data is useful because there is something to populate on the report.

    For this example we will use Accounts.

    1. Search for account in the All entities list.

    1. Select the accounts entity and use the right arrow in the middle to make it part of the Query.

    1. Click Next, and select some fields from the account entity to add to the Query.

    For this example, Name has been added.

    1. Click Finish when you have added a test data source and some test fields, then on the reports list page again under Setup and then under Query click Run Report.

    1. Click OK when the pop up is shown, and the report will run. This Report is not recognized output is expected, because this Query is not matched to any output in Lasernet Developer.

    When this report was configured, under Archiving we instructed Lasernet to save a copy of the XML file so now we can view this saved copy in the Journal.

    1. Open the Journal, identify the report that was run (there should only be one in there unless the test was run multiple times. The latest run shows at the top).

    1. Select the report, click Preview and then Show XML.

    1. Scroll through the XML message which is generated until you get to the data source which was added in the Query wizard. Here the XML is showing the name of the one test account which exists in the CE instance:

    This validates that the connection between CE and FO is working. FO is able to run a query on the CE database, extract data, bring it into the FO Connector and formulate it into an XML file that Lasernet can turn into a form output.


    What's Next