<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using Datbricks Connect with serverless compute and MLflow in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/97590#M3760</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have been using databricks-connect with serverless compute to develop and debug my databricks related code. It worked great so far. Now I started integrating ML-Flow in my workflow, and I am encountering an issue. When I run the following code, I get an exception out of the spark runtime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import mlflow
import databricks.connect as db_connect

mlflow.login(). # This prints an INFO-log: Login successfull!
# mlflow.set_model_uri("databricks)
spark_ctx = db_connect.DatbricksSession.builder.serverless(True).getOrCreate()
train_and_log_ml_model(spark_ctx)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The error message is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;pyspark.errors.exceptions.connect.AnalysisException: [CONFIG_NOT_AVAILABLE] Configuration spark.mlflow.modelRegistryUri is not available. SQLSTATE: 42K0I&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing? I there a way, to make it work?&lt;/P&gt;&lt;P&gt;Greetings, Daniel&lt;/P&gt;&lt;P&gt;P.S.: My environment is quite bare-bones: A new python-venv, where I pip installed `databricks-connect==15.1` and `mlflow`. I have configured the databricks-cli to use SSO, with a DEFAULT profile in the file `~/.databrickscfg`.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2024 17:38:21 GMT</pubDate>
    <dc:creator>DaPo</dc:creator>
    <dc:date>2024-11-04T17:38:21Z</dc:date>
    <item>
      <title>Using Datbricks Connect with serverless compute and MLflow</title>
      <link>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/97590#M3760</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have been using databricks-connect with serverless compute to develop and debug my databricks related code. It worked great so far. Now I started integrating ML-Flow in my workflow, and I am encountering an issue. When I run the following code, I get an exception out of the spark runtime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import mlflow
import databricks.connect as db_connect

mlflow.login(). # This prints an INFO-log: Login successfull!
# mlflow.set_model_uri("databricks)
spark_ctx = db_connect.DatbricksSession.builder.serverless(True).getOrCreate()
train_and_log_ml_model(spark_ctx)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The error message is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;pyspark.errors.exceptions.connect.AnalysisException: [CONFIG_NOT_AVAILABLE] Configuration spark.mlflow.modelRegistryUri is not available. SQLSTATE: 42K0I&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing? I there a way, to make it work?&lt;/P&gt;&lt;P&gt;Greetings, Daniel&lt;/P&gt;&lt;P&gt;P.S.: My environment is quite bare-bones: A new python-venv, where I pip installed `databricks-connect==15.1` and `mlflow`. I have configured the databricks-cli to use SSO, with a DEFAULT profile in the file `~/.databrickscfg`.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 17:38:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/97590#M3760</guid>
      <dc:creator>DaPo</dc:creator>
      <dc:date>2024-11-04T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using Datbricks Connect with serverless compute and MLflow</title>
      <link>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/97604#M3764</link>
      <description>&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;SPAN&gt;The error you are encountering, &lt;CODE&gt;pyspark.errors.exceptions.connect.AnalysisException: [CONFIG_NOT_AVAILABLE] Configuration spark.mlflow.modelRegistryUri is not available. SQLSTATE: 42K0I&lt;/CODE&gt;, is a known issue when using MLflow with serverless clusters in Databricks. This issue arises because the configuration &lt;CODE&gt;spark.mlflow.modelRegistryUri&lt;/CODE&gt; is not set by default in serverless environments.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;To resolve this issue, you can use a workaround that involves setting the registry URI manually. Here is a modified version of your code that includes this workaround:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import mlflow
import databricks.connect as db_connect
import mlflow.tracking._model_registry.utils

# Workaround to set the registry URI manually
mlflow.tracking._model_registry.utils._get_registry_uri_from_spark_session = lambda: "databricks-uc"

mlflow.login() # This prints an INFO-log: Login successful!
# mlflow.set_model_uri("databricks")
spark_ctx = db_connect.DatbricksSession.builder.serverless(True).getOrCreate()
train_and_log_ml_model(spark_ctx)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Nov 2024 20:01:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/97604#M3764</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-11-04T20:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Datbricks Connect with serverless compute and MLflow</title>
      <link>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/117710#M4063</link>
      <description>&lt;P&gt;Is this a problem with the serverless compute resource, I tried using the approach you recommended but still run into some issues even though I successfully connect to the tracking server.&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 13:37:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/using-datbricks-connect-with-serverless-compute-and-mlflow/m-p/117710#M4063</guid>
      <dc:creator>irfanghat</dc:creator>
      <dc:date>2025-05-05T13:37:03Z</dc:date>
    </item>
  </channel>
</rss>

