title: Spark - Reading from SQL Server using com.microsoft.azure
body: <p>I am trying to read from a table using com.microsoft.azure. Below is the code snippet </p>
  
  <pre><code>import org.apache.log4j.{Level, Logger}
  import org.apache.spark.sql.SparkSession
  import com.microsoft.azure.sqldb.spark.config.Config
  import com.microsoft.azure.sqldb.spark.connect._
  import com.microsoft.azure.sqldb.spark.query._
  import org.apache.spark.sql.functions.to_date
  
   val spark = SparkSession.builder().master("local[*]").appName("DbApp").getOrCreate()
  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")
      val config = Config(Map(
        "url"          -&gt; "jdbc:sqlserver://localhost:1433",
        "databaseName" -&gt; "Student",
        "dbTable"      -&gt; "dbo.MemberDetail",
        "authentication" -&gt; "SqlPassword",
      "user"         -&gt; "test",
      "password"     -&gt; "****"
      ))
  val df = spark.sqlContext.read.sqlDB(config)
      println("Total rows: " + df.count)
  </code></pre>
  
  <p>However I am getting below error</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: scala/Product$class
      at com.microsoft.azure.sqldb.spark.config.SqlDBConfigBuilder.&lt;init&gt;(SqlDBConfigBuilder.scala:31)
      at com.microsoft.azure.sqldb.spark.config.Config$.apply(Config.scala:254)
      at com.microsoft.azure.sqldb.spark.config.Config$.apply(Config.scala:235)
      at DbApp$.main(DbApp.scala:55)
      at DbApp.main(DbApp.scala)
  </code></pre>
  
  <p>MSSQL JDBC Version: mssql-jdbc-7.2.2.jre8
  azure-sqldb-spark version: 1.0.2</p>
  
  <p>Could anyone kindly guide me what am I doing wrong.? </p>