Last active
December 9, 2025 09:08
-
-
Save 7effrey89/8c49173e8fed40cd7098ec94ebd2e047 to your computer and use it in GitHub Desktop.
Fabric - Keyvault integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| KEYVAULT_NAME = "https://atpkvdemo.vault.azure.net" | |
| SECRET_NAME = "adslgen2key" | |
| # get access token for keyvault resource | |
| # you can also use full audience here like https://vault.azure.net | |
| accountKey = notebookutils.credentials.getSecret(KEYVAULT_NAME, SECRET_NAME) | |
| #use secret with the storage account primary access key | |
| notebookutils.fs.mount( | |
| "abfss://mycontainer@amlwsatp0010067670284.blob.core.windows.net", | |
| "/myAdslMount", | |
| {"accountKey":accountKey} | |
| ) | |
| #File read | |
| with open(notebookutils.fs.getMountPath('/myAdslMount') + "/FOD.csv", "r") as f: | |
| print(f.read()) | |
| #File write | |
| # with open(notebookutils.fs.getMountPath('/Dst') + "/myFile.txt", "w") as f: | |
| # print(f.write("dummy data")) | |
| # Unmount | |
| # notebookutils.fs.unmount("/myAdsl") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment