Hello @Danish11052000 !
Thank you for the question it really helped me to review my knowledge and go back and pay attention to this subject 😄
and guess what ? you are correct because UC permissions alone will not give complete access governance for legacy DBFS mounts. For mounts, governance has to be built from DBKS mount inventory with audit logs, Azure Storage RBAC/ACLs and storage access logs.
So for the mount inventory you can use dbutils.fs.mounts() from each workspace because they are workspace level aliases between DBFS and cloud storage and they store the storage location, driver config and credentials needed to access the data. If you check the doc they are already deprecated so you need to think about migrating to UC external locations instead. https://learn.microsoft.com/en-us/azure/databricks/dbfs/mounts
This is an example I did and it is working :
mounts = []
for m in dbutils.fs.mounts():
mounts.append({
"mount_point": m.mountPoint,
"source": m.source,
"encryption_type": getattr(m, "encryptionType", None)
})
mount_df = spark.createDataFrame(mounts)
display(mount_df)
# here u can persist for gov
mount_df.write.mode("overwrite").saveAsTable("governance_legacy.databricks_mount_inventory")this gives you the mapping :
/mnt/raw/customers -> abfss://raw@storageaccount.dfs.core.windows.net/customers
For ACLs, the permissions are not stored on the DBKS mount itself and they are enforced at the underlying ADLS Gen2 layer through Azure RBAC and POSIX ACLs. Try to check this doc it explains that part :
https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-access-control
for a single path you can check ACL with Azure CLI:
az storage fs access show \
--account-name <storage-account> \
--file-system <container> \
--path <directory-or-file-path> \
--auth-mode login
With az storage fs access show you can get ACL for a directory or file and for broader auditing you typically need to crawl the mounted ADLS path and extract ACLs using Azure CLI, PS or Azure Storage SDK.
You can list paths with FileSystemClient.get_paths() and read ACL with get_access_control()
You can also use audit logs to identify mount and unmount events but this is not the same as a full current permission model because DBKS audit logs include DBFS operational events such as mount and unmount with params like mountPoint and owner.
For storage access auditing, personally I use Azure Storage diagnostic and Azure Blob or ADLS logs can be routed to log analytics and to your info supported categories include only StorageRead, StorageWrite and StorageDelete.
If this answer resolves your question, could you please mark it as “Accept as Solution”? It will help other users quickly find the correct fix.
Senior BI/Data Engineer | Microsoft MVP Data Platform | Microsoft MVP Power BI | Power BI Super User | C# Corner MVP