Gumber, GK (Gaurav) - Thanks for the question and using MS Q&A platform.
You're trying to mount blob storage (mscstammdfacc) using Managed Identity in Azure Databricks. However, the mount fails because Hierarchical Namespace (HNS) is not enabled on the storage account. This is a known limitation: Managed Identity access via abfss:// requires HNS to be enabled, which is only available on ADLS Gen2.
✅ Recommended Approach
Step1: Can You Enable HNS on an Existing Storage Account?
No — HNS cannot be enabled on an existing storage account. If HNS is not enabled during creation, it cannot be turned on later. You must:
- Create a new storage account with HNS enabled.
- Migrate data from the old blob storage (
mscstammdfacc) to the new ADLS Gen2 account.
Step2: Steps to Create a New ADLS Gen2 Storage Account with HNS
- Go to Azure Portal → Storage Accounts → Create.
- Under Advanced, enable Hierarchical namespace.
- Set up RBAC roles for the Databricks Managed Identity:
- Assign Storage Blob Data Contributor or Storage Blob Data Owner to the Databricks workspace's Managed Identity on the new storage account.
Step3: Configure Managed Identity Access in Databricks
Your code is mostly correct. Here's a simplified version of the mount logic:
configs = {
"fs.azure.account.auth.type": "ManagedIdentity",
"fs.azure.account.oauth.msi.endpoint": "http://169.254.169.254/metadata/identity/oauth2/token",
"fs.azure.account.oauth.msi.token.provider": "org.apache.hadoop.fs.azurebfs.oauth2.MsiTokenProvider"
}
dbutils.fs.mount(
source = f"abfss://{container}@{storage_account}.dfs.core.windows.net/{folder}",
mount_point = f"/mnt/{storage_account}/{container}/{folder}_1",
extra_configs = configs
)
Make sure:
- You're using
dfs.core.windows.net(notblob.core.windows.net) for ADLS Gen2. - The storage account has HNS enabled.
- The Databricks workspace has a Managed Identity assigned and granted appropriate RBAC roles.
✅ Next Steps
- Create a new ADLS Gen2 storage account with HNS enabled.
- Migrate data from
mscstammdfaccto the new account. - Assign RBAC roles to Databricks Managed Identity.
- Update your mount logic to use the new storage account.
- Disable Shared Key access only after verifying all dependencies are updated.
Hope this helps. Let me know if you have any further questions or need additional assistance. Also, if these answers your query, do click the "Upvote" and click "Accept the answer" of which might be beneficial to other community members reading this thread.
𝘛𝘰 𝘴𝘵𝘢𝘺 𝘪𝘯𝘧𝘰𝘳𝘮𝘦𝘥 𝘢𝘣𝘰𝘶𝘵 𝘵𝘩𝘦 𝘭𝘢𝘵𝘦𝘴𝘵 𝘶𝘱𝘥𝘢𝘵𝘦𝘴 𝘢𝘯𝘥 𝘪𝘯𝘴𝘪𝘨𝘩𝘵𝘴 𝘰𝘯 𝘈𝘻𝘶𝘳𝘦 𝘋𝘢𝘵𝘢𝘣𝘳𝘪𝘤𝘬𝘴, 𝘥𝘢𝘵𝘢 𝘦𝘯𝘨𝘪𝘯𝘦𝘦𝘳𝘪𝘯𝘨, 𝘢𝘯𝘥 Data & AI 𝘪𝘯𝘯𝘰𝘷𝘢𝘵𝘪𝘰𝘯𝘴, 𝘧𝘰𝘭𝘭𝘰𝘸 𝘮𝘦 𝘰𝘯 𝘓𝘪𝘯𝘬𝘦𝘥𝘐𝘯