Pages

April 30, 2023

Azure Key vault parameter setup in D365FO

Hi Folks, 

In this post, I am going to share how to configure Azure key vault parameters in Dynamics 365 Finance and Operations  (Let's call it FinOps until we have a new name from Microsoft :) ).

First, let's understand what the use of this form is, This is primarily used for integration scenarios where a business needs to save sensitive data like security keys or certifications and a functionality or application working with this data must support data encryption, working with certificates, etc. As the cloud version of Microsoft Dynamics 365 for Finance and Operations doesn't support local storage of certificates, customers need to use key vault storage in this case. The Azure Key Vault provides the opportunity to import cryptographic keys, and certificates to Azure, and to manage them.


Now let's see some prerequisite steps, 

1. Create a key value on the Azure portal and note the Value URI. This is available on the overview tab.

2. Add your certificate, Secrate, and keys.
3. On the Azure portal, do an app registration and store the client Id and secret key.  
4. Now navigate to D365FO > System admin > Setup > Key Vault Parameters
5. Create a new record and fill below details


6. On the certification tab, add below for each certificate 
Name
Description
Secret – Enter a secret reference to the certificate in the below format
vault://<KeyVaultName>/<SecretName>/(Version if any)
Secret Type: Certificate

7. Click on Validate button to check the setting. 

That is all, now you should be able to access this certificate in your code, here is a sample code to access the certificate, 

public class TheAxaptaAccessKeyVault
{
    public static void main(Args _args)
    {
        KeyVaultCertificateTable    kvcTable;
        str                                        value

         kvcTable  = KeyVaultCertificateTable::findByName("TestKeyVault");
        value         = KeyVaultCertificateHelper::getManualSecretValue(certTable.RecId);

        info(value); //This will give you stored in the certificate. 
}

Cheers!!!

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

April 12, 2023

Unable to restore database into DEV/Tier-1 instance

Hi Folks, 


When trying to restore a DB backup (.bak file) to one of the DEV boxes I was getting a strange error (initially it was strange :) ). The backup file was the size of about 50GB and I have disc space available of about 400GB but still, system was reporting issues for size. 



Possible reason: When we create a backup from SQL management studio, it contains only the used data pages and the backup file can be compress, while the actual database can be much larger then the backup file itself.

Solution: To verify the actual size of database, you can right-click on the database (at source) and check the properties, you will get the actual size of the Database itself. Now when you have the required size details with you, just make sure you have the space available in target system. 
Now, as the dev box is hosted on your Azure subscription, you have much more control over this. You can change the disk size from Azure portal. 

Cheers!!!
-Harry 

Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta