The error message you’re encountering:
1. Hierarchical Namespace Not Enabled: This occurs when you attempt to use a databricks file system (DBFS) command like mounting, but the Azure Data Lake Storage Gen2 (ADLS Gen2) you’re working with does not have hierarchical namespace (HNS) enabled. Hierarchical namespace is a feature of ADLS Gen2 that allows directories and file operations.
2. Single Read-only File: The error also indicates that the location you are trying to access is not a directory but rather a single file, and your credentials grant only read-only access to it.
Possible Solutions
First, Enable Hierarchical Namespace on ADLS Gen2: If you're working with an ADLS Gen2 account, it must have hierarchical namespace (HNS) enabled to support file and directory operations like mounting. You can check and enable it during the creation of the storage account, but you cannot enable HNS on an existing storage account. If possible, create a new ADLS Gen2 account with hierarchical namespace enabled. When creating a storage account, ensure to check Enable hierarchical namespace.
Second, Access the File Directly Without Mounting: Since the external location is a single file and not a directory, you may not need to mount the storage location. Instead, you can directly access the file using the file path in Azure.
ShresthaBaburam