Monday 2 July 2018

How to enable licensing for your ISV solution in D365

In this blog we will discuss how you can enable licensing for both customer-specific license, and self-signed certificates.

Step 1: Create a Dynamics AX Project.



Step 2: Now add the certificate's public key (.cer file) to your project as a resource. 
2.1 Add New Item and Click Labels And Resources, and then click Resource.
2.2 Now Select the certificate's public key as the resource.





Step 3: Now add License code under Configuration Tab.

















Step 4: Assign certificate to license code property "Certificate".











Step 5: Add configuration key under Configuration Tab.



















Step 6: Assign License Code to Configuration key property "License Code".


Note: Now your Configuration for license is complete all you need to do is to 
associate a configuration key to an element. For demo purpose I am using custom form to enable licensing. In this form button is visible because it isn't controlled by a configuration key at first.























Step 7: Assign a configuration key to button control. When we assign configuration key button will not visible.










Step 8: Now In order to show the button we need to enable corresponding configuration key from License configuration page. But first check your maintenance mode. By default maintenance mode is set to OFF and you need to set it to ON.

Note: You can go through below blog which explains how to Enable maintainenace Mode through Run Command in Command Prompt or Execute Sql query. Change maintenance mode for license configuration in D365










Step 9: Your custom configuration key in License configuration setup you need to follow below steps to show your configuration key.
9.1 Collect the tenant name and ID for the customer to issue the license to. (You can find this information at Settings > About) and run command.
Command: C:\AOSService\PackagesLocalDirectory\Bin\axutil genlicense /file:c:\templicense.txt /certificatepath:c:\tempisvcert.pfx /licensecode:ISVLicenseCode /customer:Your customer Id /serialnumber:Your serial number /password:(Your certification password)
9.2 Now Import the license into the target environment.
Command: C:\AOSService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --setupmode importlicensefile --metadatadir c:\packages --bindir c:\packages --sqlserver . --sqldatabase axdbrain --sqluser AOSUser --sqlpwd ******** --licensefilename c:\templicense.txt


























Step 10: Enable your configuration key. After refresh your relevant form button control is now shown (in my case button control).

Microsoft Reference Link: ISV licensing

That is all folks, If you have any question or queries feel free to comment.

1 comment:

  1. custom configuration key in License configuration setup is not available

    ReplyDelete

How to fix Error: "Common Language Runtime detected an invalid program" in D365FO

Recently, we upgraded our environment, which resulted in one of our customizations, previously working flawlessly, throwing the "Common...