def mountStorageContainer(storageAccount, storageAccountKey, storageContainer, blobMountPoint):
print("Mounting {0} to {1}:".format(storageContainer, blobMountPoint))
if not any(mount.mountPoint == blobMountPoint for mount in dbutils.fs.mounts()):
print("....Container is not mounted; Attempting mounting now..")
mountStatus = dbutils.fs.mount(
source = "wasbs://{0}@{1}.blob.core.windows.net/".format(storageContainer, storageAccount),
mount_point = blobMountPoint,
extra_configs = {"fs.azure.account.key.{0}.blob.core.windows.net".format(storageAccount): storageAccountKey})
print("....Status of mount is: " + str(mountStatus))
else:
print("....Container is already mounted.")
print()
‹ Back to Table of Contents
Last refresh: Never