<?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: Accessing blob from databricks 403 Error Request Not authorized in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107555#M42831</link>
    <description>&lt;P&gt;No, I also regenerated the sas key. Now getting this error&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;: Operation failed: "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.", 403, GET&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2025 10:56:56 GMT</pubDate>
    <dc:creator>turagittech</dc:creator>
    <dc:date>2025-01-29T10:56:56Z</dc:date>
    <item>
      <title>Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107509#M42819</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to access a blob storage container to retrieve files. It's throwing this error.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;: Operation failed: "This request is not authorized to perform this operation using this resource type.", 403, GET,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried sas key at container and storage account levels &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what i see as the parameters in my SAS token &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;sp=rli
&amp;amp;st=2025-01-13T11:28:48Z
&amp;amp;se=2026-05-31T19:28:48Z
&amp;amp;spr=https
&amp;amp;sv=2022-11-02
&amp;amp;sr=c
&amp;amp;sig=&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Maybe there is someone else that can be suggested to make this work if it's not sas token settings&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have a screenshot of correct privileges to list and read files from the blob to make this work?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
#from azure.keyvault.secrets import SecretClient
#from azure.identity import DefaultAzureCredential
from pyspark.sql import SparkSession
from pyspark.sql import DataFrame

def list_blobs(spark: SparkSession):
    files = dbutils.fs.ls("abfss://audits@storagedev1.blob.core.windows.net/")
    display(files)
if __name__ == "__main__":
    spark = SparkSession \
        .builder \
        .appName("Python Spark SQL data source example") \
        .getOrCreate()
    #Key1 = "Auditkey"
    #Key2 = "auditkey2"
    key_scope= "DataBricksDevSecrets"
    key_secret = "auditkey2"
    storage_account = "storagedev1"

    fs_sas_fixed_string = "fs.azure.sas.fixed.token." + storage_account + ".blob.core.windows.net"
    fs_auth_string = "fs.azure.account.auth.type."+ storage_account + ".blob.core.windows.net"
    fs_sas_provider_string = "fs.azure.sas.token.provider.type."+ storage_account + ".blob.core.windows.net"

    spark.conf.set(fs_auth_string, "SAS")
    spark.conf.set(fs_sas_provider_string, "org.apache.hadoop.fs.azurebfs.sas.FixedSASTokenProvider")
    spark.conf.set(fs_sas_fixed_string, dbutils.secrets.get(scope=key_scope, key=key_secret))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Jan 2025 05:08:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107509#M42819</guid>
      <dc:creator>turagittech</dc:creator>
      <dc:date>2025-01-29T05:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107511#M42820</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/74890"&gt;@turagittech&lt;/a&gt;&amp;nbsp;Please check the below article for possible methods to connect to&amp;nbsp;Azure Data Lake Storage Gen2 and Blob Storage&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.databricks.com/en/connect/storage/azure-storage.html#set-spark-properties-to-configure-azure-credentials-to-access-azure-storage" target="_blank" rel="noopener noreferrer"&gt;https://docs.databricks.com/en/connect/storage/azure-storage.html#set-spark-properties-to-configure-azure-credentials-to-access-azure-storage&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To set Spark properties, use the following snippet in a cluster’s Spark configuration or a notebook:&lt;/P&gt;
&lt;P&gt;spark.conf.set("fs.azure.account.auth.type.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", "SAS")&lt;/P&gt;
&lt;P&gt;spark.conf.set("fs.azure.sas.token.provider.type.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.sas.FixedSASTokenProvider")&lt;/P&gt;
&lt;P&gt;spark.conf.set("fs.azure.sas.fixed.token.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", dbutils.secrets.get(scope="&amp;lt;scope&amp;gt;", key="&amp;lt;sas-token-key&amp;gt;"))&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 05:44:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107511#M42820</guid>
      <dc:creator>Allia</dc:creator>
      <dc:date>2025-01-29T05:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107516#M42823</link>
      <description>&lt;P&gt;That delivers the following message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;: org.apache.hadoop.fs.FileAlreadyExistsException: Operation failed: "This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint.", 409, GET&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now can someone explain why abfss only shows examples using&amp;nbsp; the dfs and does SFS need hierarchical data file systems enabled?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 06:37:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107516#M42823</guid>
      <dc:creator>turagittech</dc:creator>
      <dc:date>2025-01-29T06:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107517#M42824</link>
      <description>&lt;P&gt;@&lt;A id="link_16" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.databricks.com/t5/user/viewprofilepage/user-id/74890" target="_self" aria-label="View Profile of turagittech"&gt;&lt;SPAN class=""&gt;turagittech&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;Are you able to access the Blob storage after disabling soft delete?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 06:48:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107517#M42824</guid>
      <dc:creator>Allia</dc:creator>
      <dc:date>2025-01-29T06:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107555#M42831</link>
      <description>&lt;P&gt;No, I also regenerated the sas key. Now getting this error&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;: Operation failed: "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.", 403, GET&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 10:56:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107555#M42831</guid>
      <dc:creator>turagittech</dc:creator>
      <dc:date>2025-01-29T10:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107604#M42856</link>
      <description>&lt;P&gt;can you try this for specific container?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# Configure the Spark session to use the SAS key for Data Lake Storage Gen2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;spark.conf.set(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"fs.azure.sas.&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;container_name&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;storage_account_name&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;.dfs.core.windows.net"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;sas_key&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Jan 2025 14:09:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107604#M42856</guid>
      <dc:creator>saurabh18cs</dc:creator>
      <dc:date>2025-01-29T14:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing blob from databricks 403 Error Request Not authorized</title>
      <link>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107679#M42885</link>
      <description>&lt;P&gt;I have tested that and no improvement. I have also tried with a Service principal to see if another error message occurred to find the issue.&lt;/P&gt;&lt;P&gt;I do have a question, must we use the dfs url to access blob soreage with abfss? Is that only enabled when you configure heirarchical file system? Or is ther away to enable it without? I am not resolving the dfs host in dns.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 01:13:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/accessing-blob-from-databricks-403-error-request-not-authorized/m-p/107679#M42885</guid>
      <dc:creator>turagittech</dc:creator>
      <dc:date>2025-01-30T01:13:26Z</dc:date>
    </item>
  </channel>
</rss>

