
with the name of the ADLS Gen2 storage account.with the name of the intended mount point in DBFS.Īccess files in your ADLS Gen2 filesystem as if they were files in DBFS:.with the ADLS Gen2 storage account name.with the name of a container in the ADLS Gen2 storage account.with the Directory (tenant) ID for the Azure Active Directory application.with the name of the key containing the client secret.
with the Databricks secret scope name. with the Application (client) ID for the Azure Active Directory application. mount ( source =, mountPoint = "/mnt/", extraConfigs = configs ) get ( scope = "", key = "" ), "fs.endpoint" -> "" ) // Optionally, you can add to the source URI of your mount point. Run the following in your notebook to authenticate and create a mount point. To resolve such an error, you must unmount and remount the storage. If mounted storage relies on a secret that is rotated, expires, or is deleted, errors can occur, such as 401 Unauthorized. Mount points that use secrets are not automatically refreshed. Ensure that production jobs do not unmount storage as part of processing. Unmounting a mount point while jobs are running can lead to errors. To use the mount point in another running cluster, you must run dbutils.fs.refreshMounts() on that running cluster to make the newly created mount point available for use. When you create a mount point through a cluster, cluster users can immediately access the mount point. The service principal you use to access the ADLS Gen2 account should be granted access only to that ADLS Gen2 account it should not be granted access to other Azure resources. All users in the Databricks workspace have access to the mounted ADLS Gen2 account.
Authenticate and access the ADLS Gen2 storage account through direct access. You’ll need to create one or more containers before you can access an ADLS Gen2 storage account. Like directories in a filesystem, containers provide a way to organize objects in an Azure storage account. Create one or more containers inside the storage account. Assign roles to the application to provide the service principal with the required permissions to access the ADLS Gen2 storage account. The secret scope provides secure storage of the secret and allows it to be used without directly referencing it in configuration. The client secret is required for authenticating to the storage account. Save the client secret associated with the Azure AD application in the secret scope.
The secret scope will securely store the client secret associated with the Azure AD application.
Create a secret scope in your Databricks workspace. Create an Azure AD application, which will create an associated service principal used to access the storage account. The following is an overview of the tasks this article walks through: This article describes creating an Azure AD application and service principal and using that service principal to mount or directly access data in an ADLS Gen2 storage account. This feature of mount points may provide a better user experience for multiple users accessing common resources in a workspace. In contrast, direct access paths need to be fully specified in your notebooks.
Mount points also provide the benefit of being easily accessible across a workspace using standard file system semantics. To provide access to multiple workspace users with different permissions, access data directly through the Azure Blob File System (ABFS) driver.To provide access to a specific path or file to multiple workspace users, create a mount point to the required storage resource and path.The option to select depends on how you plan to use Databricks with ADLS Gen2 storage: A mount point to a specific file or path.Using a service principal for authentication provides two options for accessing data in your storage account: You can securely access data in an Azure Data Lake Storage Gen2 (ADLS Gen2) account using OAuth 2.0 with an Azure Active Directory (Azure AD) application service principal for authentication. Azure Data Lake Storage Gen2 frequently asked questions and known issuesĪccess Azure Data Lake Storage Gen2 using OAuth 2.0 with an Azure service principal.Add the client secret to a secret scope.Register an Azure Active Directory application.Access Azure Data Lake Storage Gen2 using OAuth 2.0 with an Azure service principal.Get started with Azure Data Lake Storage Gen2.Introduction to importing, reading, and modifying data.Databricks Data Science & Engineering guide.