# Logstash.inputs.jdbc connect to Azure SQL Server throw exception

**URL:** <https://discuss.elastic.co/t/logstash-inputs-jdbc-connect-to-azure-sql-server-throw-exception/319603>\
**Category:** Logstash\
**Tags:** jdbc\
**Created:** [November 23, 2022, 1:59am UTC](https://discuss.elastic.co/t/logstash-inputs-jdbc-connect-to-azure-sql-server-throw-exception/319603 "2022-11-23T01:59:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuxiao617111](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liuxiao617111/32/113667_2.png) [@liuxiao617111](https://discuss.elastic.co/u/liuxiao617111)\
**Post date:** [November 23, 2022, 1:59am UTC](https://discuss.elastic.co/t/logstash-inputs-jdbc-connect-to-azure-sql-server-throw-exception/319603/1 "2022-11-23T01:59:15Z")

</div>

when I using "authentication=ActiveDirectoryPassword" to connect Azure SQL server. It throw an exception: " **Failed to load MSAL4J Java library for performing ActiveDirectoryPassword authentication.**".

**Logstash Version** : 7.17.7

**This is my config:**

```auto
input {
    jdbc {
        jdbc_driver_library => "/usr/share/logstash/expendlib/mssql-jdbc-11.2.0.jre11.jar"
        jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
        jdbc_connection_string => "jdbc:sqlserver://xxxxxx.database.windows.net:1433;databaseName=xxxx;encrypt=true;authentication=ActiveDirectoryPassword;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"
        jdbc_user => "xxx@xxxxx.com"
        jdbc_password => 'xxxxxx'
        schedule => "/10 * * * * *"
        jdbc_default_timezone => "Asia/Shanghai"
        jdbc_page_size => "500"
        record_last_run => "true"
        use_column_value => "true"
        tracking_column => "Id"
        last_run_metadata_path => "/config/dataid/xxx_id"
        lowercase_column_names => "false"
        tracking_column_type => "numeric"
        clean_run => "false"
        statement => "select * from table"
        type => "xxxx"
    }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 21, 2022, 2:00am UTC](https://discuss.elastic.co/t/logstash-inputs-jdbc-connect-to-azure-sql-server-throw-exception/319603/2 "2022-12-21T02:00:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
