web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Could not load type Microsoft.Azure.KeyVault.IKeyVaultClient from Microsoft.Azure.KeyVault version = 1.0.0.0

(0) ShareShare
ReportReport
Posted on by 21

Hi everyone,

I'm trying to use the encryption functionality provided by Azure Key Vault.

I saw that we have a reference in AOT to Microsoft.Dynamics.AX.KeyVaultEncryptionUtility and method Encrypt inside it.

I have my Key Vault created in Azure Portal and set in Key Vault Parameters in D365FO (validated successfully).

1641.pastedimage1581515901934v2.png

My code (developed just to test) goes like this:

8814.pastedimage1581515766690v1.png

When i run the class, I'm getting the following error:

3716.pastedimage1581516169426v3.png

I also tried the development of a class library, referencing version 3.0.5.0 of Microsoft.Azure.KeyVault, where we make an authenticaiton request to the key vault and use the EncryptAsync method of the KeyVaultClient instance but I get the exact same error. I'm wondering why the system is fetching version 1.0.0.0 of Microsoft.Azure.KeyVault instead of the version referenced in the class library.

Can someone help me please?

Thanks in advance.

Note: I'm new in the community and this is my first post. If this is not clear enough please let me know so that I can provide some more details.

I have the same question (0)
  • Community Member Profile Picture
    on at

    If you are trying to get a manual value from key vault

    you could use the following method,

    KeyVaultCertificateHelper::getManualSecretValue(<RecId of the Key vault secret record>);

  • Ricardo Couto Profile Picture
    21 on at

    Hi Bharath,

    First of all, thank you for your reply.

    What you say is correct, but it would return the secret that holds the certificate I want to use to encrypt data. Then how could I acctually use the secret and call the Encryption method? Am I going to be able to get around the error described (related to version of Microsoft.Azure.KeyVault) if I use what you suggest? My guess is that it is not entirely related.

    Is the KeyVaultEncryptionUtility the best approach to achieve what I want? I believe there is not much documentation on how to use Key Vault to encrypt data, but I would like to understand how the Microsoft.Dynamics.AX.KeyVaultEncryptionUtility reference can be used to achieve my goal. The name of the reference is self explanatory so I believe I should use it because it is exactly what I want.

    I apologize if I'm getting something wrong. Please let me know your thoughts on this.

    Thank you.

  • Community Member Profile Picture
    on at

    Hi,

    If you have added the Microsoft.Azure.KeyVault, I noticed one thing. When i'm trying to add a new reference, it fails to delete and replace the new one.

    I stopped all services, reset IIS , I went to the Model bin folder and deleted the existing reference and add the new reference.

  • Ricardo Couto Profile Picture
    21 on at

    Hi,

    sorry for the late reply, we ended up following a different approach, but thank you very much for your help. It's appreciated.

  • Rogerio da Costa Profile Picture
    26 on at

    Hi Ricardo, would you please share what solution you ended-up with? I'm facing this exactly same error as you trying the same two different options as you stated.

  • Ricardo Couto Profile Picture
    21 on at

    Hi Rogerio,

    The approach we followed involves the usage of a paid software, which I believe you can find if you just search for D365FO encryption. Regarding this specific issue, you can always communicate the issue to Microsoft, if you do not need this solved urgently.

    Hope this is useful information that help you achieve your goal.

    Regards,

    Ricardo Couto

  • Aashay147 Profile Picture
    15 on at

    A late reply to the post, but I was able to achieve this within X++ without using a custom DLL:

    https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/410873/finops-data-encryption-using-azure-key-vault

    Posting here for anyone interested.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans