Synapse: SAS Token

(Last Updated On: )

This post is how to get the SAS token from a notebook.

Ensure you have a spark session created. Refer to PySpark: Create a Spark Session

  1. from notebookutils import mssparkutils
  2.  
  3. linked_service_storage_account_name = '<LINKED_SERVICE_STORAGE_NAME>'
  4. blob_sas_token = mssparkutils.credentials.getConnectionStringOrCreds(linked_service_storage_account_name)
  5.  
  6. spark.conf.set('fs.azure.sas.<CONTAINER_NAME>.<ADLS_STORAGE_ACCOUNT_NAME>.blob.core.windows.net', blob_sas_token