Import & export
Azure Blob Storage
Available to teams and users on all plans
Deepnote can fetch blobs from Azure Blob Storage. Follow these docs to create your own notebook to connect to your storage container.
Click the "duplicate" button on the top right corner to do this. Once you've got the template in your Deepnote workspace, you can connect it to your Synapse workspace.
To fetch blobs from an Azure storage container, you need a connection string for the container's storage account. Find your connection string by following these instructions.
Change the variable
AZURE_BLOG_STORAGE_CONNECTION_STRING to match the connection string. If you'd like to keep your data secure, consider storing the token as an environment variable. Environment variables in Deepnote are encrypted and provide a secure way of storing sensitive data.
AZURE_BLOB_STORAGE_CONTAINER_NAME to the name of the container you want to fetch blobs from.
The notebook will set up a
container_client that you can use to fetch any of the blobs in a container. For example, to get a list of all the blobs.
# Fetch all the blobs and their names blobs = [*container_client.list_blobs()] blob_names = [blob.name for blob in blobs] blob_names
When executing the code above, Deepnote will show the
blob_names result as a list.
You can also fetch individual blobs. In our example, our blobs are images (of Mars!), so we generate a thumbnail.
blob_download_stream = container_client.download_blob(blob_names) image = Image.open(io.BytesIO(blob_download_stream.readall())) image_thumbnail = image.copy() image_thumbnail.thumbnail([500, 500]) image_thumbnail.show()
When executing this, Deepnote will fetch the blob and display the thumbnail.
Now that you're fetching blobs, you can share it with your team. You can even turn your charts into a shareable dashboard.
For more information on how to use the Azure SDK, you can read their docs.
Still need help? Deepnote's community of over 5,000 data enthusiasts and professionals is always there for you. Post any questions into the Q&A channel here.