<?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 Re: [Azure Databricks]: Use managed identity to access mlflow models and artifacts in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/123870#M3568</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164673"&gt;@quad_t&lt;/a&gt;, were you able to find a solution to this problem? I'm having similar issues when trying to use MSI to connect to MLflow.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jul 2025 12:10:54 GMT</pubDate>
    <dc:creator>ali_daei</dc:creator>
    <dc:date>2025-07-03T12:10:54Z</dc:date>
    <item>
      <title>[Azure Databricks]: Use managed identity to access mlflow models and artifacts</title>
      <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/119379#M3365</link>
      <description>&lt;P&gt;Hello! I am new to Azure Databricks and have a question: In my current setup, I am running some containerized python code within an azure functions app. In this code, I need to download some models and artifacts stored via mlflow in our Azure Databricks workspace.&lt;BR /&gt;&lt;BR /&gt;Previously, I have done this by setting `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables and then within my code I just set `mlflow.set_tracking_uri("databricks")` and all worked fine. However, the token is a PAT, which I do not like from a security perspective. Ideally, I would like to use the managed Identity of the functions app to authenticate with databricks. According to the following article, this should be possible:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/azure-mi-auth" target="_self"&gt;https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/azure-mi-auth&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;So I essentially repeated the steps in the article. Note that I omitted all account-level authorization steps, since workspace-level authorization is enough for my use case.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;- I created a user-assigned managed Identity in Azure&lt;BR /&gt;- I assigned the managed identity to the functions app&lt;BR /&gt;- I added a new &lt;STRONG&gt;entra ID managed&lt;/STRONG&gt; service principal in my Azure Databricks workspace, using the &lt;STRONG&gt;client ID&lt;/STRONG&gt; of the managed identity as &lt;STRONG&gt;application Id&lt;BR /&gt;- &lt;/STRONG&gt;I created the respective config file `~/.databrickscfg`, adding a single profile with the name `[AZURE_MI_WORKSPACE]`, containing the parameters `host` (my azure databricks workspace URL), `azure_workspace_resource_id` (resource ID of my azure databricks workspace), `azure_client_id` (the client ID of the managed Identity), `azure_tenant_id` (my azure tenant ID) and I set `azure_use_msi` to `true`, just as in the config in the referenced article above&lt;BR /&gt;&lt;BR /&gt;Then, I changed my code to `mlflow.set_tracking_uri("databricks://AZURE_MI_WORKSPACE")`. The code proceeds to read the information from the `.databrickscfg` file, since I get the output&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;loading AZURE_MI_WORKSPACE profile from ~/.databrickscfg: host, azure_workspace_resource_id, azure_client_id, azure_use_msi, azure_tenant_id&lt;/LI-CODE&gt;&lt;P&gt;But when setting the tracking uri, I get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Reading Databricks credential configuration failed with MLflow tracking URI 'databricks://AZURE_MI_WORKSPACE'. Please ensure that the 'databricks-sdk' PyPI library is installed, the tracking URI is set correctly, and Databricks authentication is properly configured. The tracking URI can be either 'databricks' (using 'DEFAULT' authentication profile) or 'databricks://{profile}'. You can configure Databricks authentication in several ways, for example by specifying environment variables (e.g. DATABRICKS_HOST + DATABRICKS_TOKEN) or logging in using 'databricks auth login'.&lt;/LI-CODE&gt;&lt;P&gt;Do you have any leads what could be wrong here? I triple checked the parameters in the config files and they are definitely correct. I was asking myself if I made some kind of conceptual error and the mlflow tracking can't be done via managed identity auth for some reason.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 18:53:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/119379#M3365</guid>
      <dc:creator>quad_t</dc:creator>
      <dc:date>2025-05-15T18:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: [Azure Databricks]: Use managed identity to access mlflow models and artifacts</title>
      <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/123870#M3568</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164673"&gt;@quad_t&lt;/a&gt;, were you able to find a solution to this problem? I'm having similar issues when trying to use MSI to connect to MLflow.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2025 12:10:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/123870#M3568</guid>
      <dc:creator>ali_daei</dc:creator>
      <dc:date>2025-07-03T12:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: [Azure Databricks]: Use managed identity to access mlflow models and artifacts</title>
      <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/123880#M3570</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/173607"&gt;@ali_daei&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, indeed! I discussed this in a Microsoft Q and A forum and got an answer that works. Check the answer here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/answers/questions/2276345/use-managed-identity-to-access-mlflow-models-and-a" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/answers/questions/2276345/use-managed-identity-to-access-mlflow-models-and-a&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In short: Do NOT use client_id, tenant_id etc. but stick to the usual DATABRICKS_HOST and DATABRICKS_TOKEN environment variable approach. For the token, you need to generate it for the Managed Identity you want to access your workspace with. It can be done with &lt;EM&gt;ManagedIdentityCredential&lt;/EM&gt; of the &lt;EM&gt;azure.identity&lt;/EM&gt; package if you are using the python SDK (see code snippet in the accepted answer in the microsoft forum link).&lt;/P&gt;&lt;P&gt;One thing that confused me at first was the&amp;nbsp;&lt;SPAN&gt;Azure Databricks resource App ID that you need to use to generate the token. It looks like some custom UUID, but it&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;is apparently a commonly known STATIC id that is the same for all azure databricks resources. So when generating the token, alsways use&lt;/P&gt;&lt;LI-CODE lang="python"&gt;token = credential.get_token("2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default")&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The id&amp;nbsp;&lt;SPAN class=""&gt;&lt;EM&gt;2ff814a6-3304-4ab8-85cb-cd0e6f879c1d&lt;/EM&gt; ALWAYS is the same for any azure databricks resource. Again, check out the above link for a more detailed discussion.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2025 13:01:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/azure-databricks-use-managed-identity-to-access-mlflow-models/m-p/123880#M3570</guid>
      <dc:creator>quad_t</dc:creator>
      <dc:date>2025-07-03T13:01:42Z</dc:date>
    </item>
  </channel>
</rss>

