ADX plugin postgresql_request failed to load System.Security.Cryptography.Algorithms

lwerthm 0 Reputation points
2024-11-13T10:24:34.47+00:00

I have an Azure Data Explorer (ADX) instance in combination with a PostgreSQL Flexible Server (16.4) and want to access the SQL table test_adx_meta from ADX.
There are no firewall or IP range limitations.

I followed the official postgres_request command documentation and also enabled the plugin.

.show plugins | where PluginName == "postgresql_request"

"PluginName": postgresql_request, "IsEnabled": true, "Description": Version=2

SQL Table:

CREATE TABLE test_adx_meta (
  id integer PRIMARY KEY,
  value varchar NOT NULL
);

ADX Query:

evaluate postgresql_request(
    'Host=***.postgres.database.azure.com; Port = 5432;'
    'Database=db;'
    'User Id=***; Password=***;'
    'select * from "test_adx_meta"'): (id: int, value: string)

Partial query failure: 0x80131500 (message: ExecutePluginOperator failure ===> Error occured when executing postgresql request. Could not load file or assembly 'System.Security.Cryptography.Algorithms, Version=4.3.0.0, Culture=neutral, PublicKeyToken=<...>' or one of its dependencies. The system cannot find the file specified.: ),

I seems that the implementation of the Kusto plugin can not load the .NET lib System.Security.Cryptography.Algorithms.

Does anybody have seen an similar issue or has an idea what is happening ? Thx :)

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
534 questions
Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. Sina Salam 12,816 Reputation points
    2024-11-13T13:33:11.27+00:00

    Hello lwerthm,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that your ADX plugin postgresql_request failed to load System.Security.Cryptography.Algorithms.

    The error you’re posted shows that the postgresql_request plugin in Azure Data Explorer (ADX) indicates that the required .NET library (System.Security.Cryptography.Algorithms) is either missing or not properly loaded.

    This is what you can do to fix it:

    1. Make sure that the postgresql_request plugin is properly configured and enabled in your ADX environment. Using KQL as in the following query:
         .show plugins | where PluginName == "postgresql_request"
      
      If the plugin is enabled and its version is correct (Version=2), proceed to the next step.
    2. Confirm that your ADX instance is running on the latest version. Azure Data Explorer updates can include bug fixes or compatibility improvements and check for updates or version notes related to your ADX cluster.
    3. Make sure your PostgreSQL connection string is correct and follows the required format:
    evaluate postgresql_request(
        'Host=your_postgresql_server.postgres.database.azure.com; Port=5432;'
        'Database=your_database;'
        'User Id=your_user; Password=your_password;'
        'select * from "test_adx_meta"'): (id: int, value: string)
    

    Ensure:

    • Hostname is correct.
    • Proper port (5432 for PostgreSQL) is used.
    • Credentials (User Id and Password) are accurate.
    • Database name matches exactly, including case sensitivity.
    1. Also, note that the System.Security.Cryptography.Algorithms library issue might occur due to a misconfigured or outdated plugin runtime environment. Update .NET Dependencies, ADX’s plugin framework depends on .NET components. While this is managed by Azure, the issue could stem from an outdated environment in the cluster. You can address this by:
    • Go to the Azure Data Explorer Cluster settings in the Azure portal.
    • Under **Settings > Configurations, restart the cluster to refresh its runtime dependencies.
    1. Ensure that all plugin dependencies are loaded by running using KQL: .show diagnostics

    Look for any errors or warnings related to postgresql_request or missing assemblies. If dependencies like System.Security.Cryptography.Algorithms are still not loaded, it might indicate a cluster environment issue.

    1. If the issue persists, try using external tools (like PowerShell or Azure Data Studio) to validate that PostgreSQL can be accessed using the same connection string. Alternatively, test querying PostgreSQL via an external ADX query client using similar setup.
    2. If the above steps don’t resolve the issue: Raise a support request** through the Azure portal and provide them with:
    • The error message.
    • Plugin details.
    • ADX version and cluster diagnostics.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


  2. Sridhar Peddi 0 Reputation points
    2024-11-14T17:50:01.5166667+00:00

    The primary failure here seems related to .NET dependencies, specifically System.Security.Cryptography.Algorithms. This indicates:

    • An outdated plugin runtime in the ADX environment.
    • Misconfigured or corrupted dependency installations.
    • A mismatch between the expected .NET runtime version and the installed version in the Azure environment.

    Steps That Might Work Instead

    • Explicitly verify the .NET runtime version installed on the ADX cluster.
    • Ensure the System.Security.Cryptography.Algorithms library version is correctly installed and matches the plugin’s requirements.
    • Test a manual update of the .NET dependencies on the ADX environment.
    • If possible, isolate the issue using a fresh ADX instance and verify that plugin installation completes without dependency errors. Likely Root Issue The primary failure here seems related to .NET dependencies, specifically System.Security.Cryptography.Algorithms. This indicates:
      • An outdated plugin runtime in the ADX environment.
      • Misconfigured or corrupted dependency installations.
      • A mismatch between the expected .NET runtime version and the installed version in the Azure environment.
      Steps That Might Work Instead
      • Explicitly verify the .NET runtime version installed on the ADX cluster.
      • Ensure the System.Security.Cryptography.Algorithms library version is correctly installed and matches the plugin’s requirements.
      • Test a manual update of the .NET dependencies on the ADX environment.
      • If possible, isolate the issue using a fresh ADX instance and verify that plugin installation completes without dependency errors.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.