title: Why can't Databricks Python read from my Azure Datalake Storage Gen1?
body: <p>I am trying to read a file <code>mydir/mycsv.csv</code> from Azure Data Lake Storage Gen1 from a Databricks notebook, using the syntax (inspired by the <a href="https://docs.databricks.com/spark/latest/data-sources/azure/azure-datalake.html" rel="nofollow noreferrer">documentation</a>)</p>
  
  <pre><code>configs = {"dfs.adls.oauth2.access.token.provider.type": "ClientCredential",
             "dfs.adls.oauth2.client.id": "123abc-1e42-31415-9265-12345678",
             "dfs.adls.oauth2.credential": dbutils.secrets.get(scope = "adla", key = "adlamaywork"),
             "dfs.adls.oauth2.refresh.url": "https://login.microsoftonline.com/123456abc-2718-aaaa-9999-42424242abc/oauth2/token"}
  
  dbutils.fs.mount(
    source = "adl://myadls.azuredatalakestore.net/mydir",
    mount_point = "/mnt/adls",
    extra_configs = configs)
  
  post_processed = spark.read.csv("/mnt/adls/mycsv.csv").collect()
  
  post_processed.head(10).to_csv("/dbfs/processed.csv")
  
  dbutils.fs.unmount("/mnt/adls")
  </code></pre>
  
  <p>My client <code>123abc-1e42-31415-9265-12345678</code> has access to the Data Lake Storage <code>myadls</code> and I have created secrets with</p>
  
  <pre><code>databricks secrets put --scope adla --key adlamaywork
  </code></pre>
  
  <p>When I execute the pyspark code above in the Databricks notebook, when accessing the csv file with <code>spark.read.csv</code>, I get </p>
  
  <blockquote>
    <p>com.microsoft.azure.datalake.store.ADLException: Error getting info
    for file /mydir/mycsv.csv</p>
  </blockquote>
  
  <p>When navigating the dbfs with <code>dbfs ls dbfs:/mnt/adls</code>, the parent mount point seems to be there, but I get </p>
  
  <blockquote>
    <p>Error: b'{"error_code":"IO_ERROR","message":"Error fetching access
    token\nLast encountered exception thrown after 1 tries
    [HTTP0(null)]"}'</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>