{"id":373,"date":"2023-10-18T18:13:39","date_gmt":"2023-10-18T16:13:39","guid":{"rendered":"https:\/\/www.syntera.ch\/blog\/?p=373"},"modified":"2025-12-16T09:31:44","modified_gmt":"2025-12-16T08:31:44","slug":"how-to-access-azure-key-vault-secrets-from-fabric-notebook","status":"publish","type":"post","link":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/","title":{"rendered":"How-To Access Azure Key Vault Secrets from Fabric Notebook"},"content":{"rendered":"\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-f56f613f wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-post-author has-medium-font-size\"><div class=\"wp-block-post-author__avatar\"><img alt='' src='https:\/\/secure.gravatar.com\/avatar\/bd3589b8a6ccc62e37c3cee8f8e06c73a4085816337ad7d6c154e30dc60cc4c1?s=48&#038;d=mm&#038;r=g' srcset='https:\/\/secure.gravatar.com\/avatar\/bd3589b8a6ccc62e37c3cee8f8e06c73a4085816337ad7d6c154e30dc60cc4c1?s=96&#038;d=mm&#038;r=g 2x' class='avatar avatar-48 photo' height='48' width='48' \/><\/div><div class=\"wp-block-post-author__content\"><p class=\"wp-block-post-author__byline\">LEAD DATA ENGINEERING<\/p><p class=\"wp-block-post-author__name\">Dominic Schranz<\/p><\/div><\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-outermost-social-sharing alignright has-small-icon-size has-icon-color is-style-logos-only is-content-justification-left is-layout-flex wp-container-outermost-social-sharing-is-layout-fa5e4718 wp-block-outermost-social-sharing-is-layout-flex\"><li style=\"color: #1a4548\" class=\"outermost-social-sharing-link outermost-social-sharing-link-linkedin has-primary-color wp-block-outermost-social-sharing-link\">\n\t<a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.syntera.ch%2Fblog%2F2023%2F10%2F18%2Fhow-to-access-azure-key-vault-secrets-from-fabric-notebook%2F&#038;title=How-To%20Access%20Azure%20Key%20Vault%20Secrets%20from%20Fabric%20Notebook\" aria-label=\"Share on LinkedIn\" rel=\"noopener nofollow\" target=\"_blank\" class=\"wp-block-outermost-social-sharing-link-anchor\">\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"><\/path><\/svg>\t\t<span class=\"wp-block-outermost-social-sharing-link-label screen-reader-text\">\n\t\t\tShare on LinkedIn\t\t<\/span>\n\t<\/a>\n<\/li>\n\n\n<li style=\"color: #1a4548\" class=\"outermost-social-sharing-link outermost-social-sharing-link-mail has-primary-color wp-block-outermost-social-sharing-link\">\n\t<a href=\"mailto:?subject=How-To%20Access%20Azure%20Key%20Vault%20Secrets%20from%20Fabric%20Notebook&#038;body=How-To%20Access%20Azure%20Key%20Vault%20Secrets%20from%20Fabric%20Notebook%20&mdash;%20https%3A%2F%2Fwww.syntera.ch%2Fblog%2F2023%2F10%2F18%2Fhow-to-access-azure-key-vault-secrets-from-fabric-notebook%2F\" aria-label=\"Email this Page\"  class=\"wp-block-outermost-social-sharing-link-anchor\">\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z\"><\/path><\/svg>\t\t<span class=\"wp-block-outermost-social-sharing-link-label screen-reader-text\">\n\t\t\tEmail this Page\t\t<\/span>\n\t<\/a>\n<\/li>\n\n\n<li style=\"color: #1a4548\" class=\"outermost-social-sharing-link outermost-social-sharing-link-whatsapp has-primary-color wp-block-outermost-social-sharing-link\">\n\t<a href=\"https:\/\/api.whatsapp.com\/send?text=How-To%20Access%20Azure%20Key%20Vault%20Secrets%20from%20Fabric%20Notebook%20&mdash;%20https%3A%2F%2Fwww.syntera.ch%2Fblog%2F2023%2F10%2F18%2Fhow-to-access-azure-key-vault-secrets-from-fabric-notebook%2F\" aria-label=\"Share on WhatsApp\" rel=\"noopener nofollow\" target=\"_blank\" class=\"wp-block-outermost-social-sharing-link-anchor\">\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z\"><\/path><\/svg>\t\t<span class=\"wp-block-outermost-social-sharing-link-label screen-reader-text\">\n\t\t\tShare on WhatsApp\t\t<\/span>\n\t<\/a>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Microsoft Fabric is getting closer to general availability and while there are already many features available, not everything is supported yet. This blog post focuses on how to handle authentication within Fabric Notebooks using secrets without storing them in your code. Refresh your knowledge on why we should not store secrets in clear text and discover a secure way to use Key Vault in combination with Fabric Notebooks. By the end of this blog post, you know why and how to access secrets from Key Vault. If you are only interested in the code, jump to the solution <a href=\"http:\/\/syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook#Solution\">here<\/a>.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#ebf6f7\"><strong>Update 15.12.2025<\/strong>: It is now possible to run Notebooks using Service Principal credentials! <a href=\"https:\/\/www.syntera.ch\/blog\/2025\/12\/15\/fabric-notebook-key-vault-access-with-service-principal\/\">Read here how to get Key Vault Secrets in Fabric Notebooks via Service Principal<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><em>Update 10.10.2024:<\/em> Microsoft released <a href=\"https:\/\/learn.microsoft.com\/en-us\/fabric\/security\/workspace-identity\" target=\"_blank\" rel=\"noreferrer noopener\">workspace identities for Fabric<\/a>. However, the workspace identity currently only supports connections to storage accounts and not Key Vaults. With the provided solution, Fabric Notebook can still access Key Vaults using the user context.<br><br><em>Update 18.02.2024<\/em>: With notebookutils.credentials.getSecret() it is now possible to get key vault secrets directly, check the <a href=\"http:\/\/syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook#Solution\">code example below<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">The Dangers of Clear Text Secrets in Your Code<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In today&#8217;s software development landscape, security is paramount. Storing secrets like API keys, database credentials, or access tokens in clear text within your code is a risky practice that should be avoided at all costs. Consider these reasons why you should avoid hardcoding secrets in your code:<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Security Risks<\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">Perhaps the most compelling reason is the inherent security risks. When secrets are hardcoded into your source code, they become readily accessible to anyone with access to the codebase. This includes not only your development team but also potential malicious actors who may gain unauthorized access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Clear text secrets in code are comparable to leaving your front door wide open and hoping that no one will walk in. If an attacker gains access to your source code, they can easily locate and misuse these secrets to compromise your systems and data. The possible consequences are data breaches, financial losses and damage to your organization&#8217;s reputation.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Lack of Control<\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">Another significant drawback is the lack of control. Over time, as your application evolves and the team working on it expands, managing secrets becomes increasingly complex. When secrets are hardcoded, making changes or revoking access can become an impossible task.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Consider a scenario where you need to rotate an API key or update a database password due to a security incident or routine maintenance. If these secrets are scattered throughout your codebase, tracking them all down and ensuring that the changes are properly propagated can be error-prone and time-consuming. This lack of control can lead to potential security lapses and operational headaches.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What is Azure Key Vault<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Azure Key Vault serves as a cloud-based solution to store and access secrets securely. In this context, secrets can be a wide array of data which you want to keep save. This can include API keys, passwords, certificates, or cryptographic keys. By integrating Azure Key Vault with your applications, you can store secrets in a centralized and highly secure repository, separated from your source code. This approach not only mitigates the security risks associated with clear text secrets but also streamlines the management of sensitive information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Storing the secrets in Key Vault is a very good solution but you have to make sure your process is able to access the secrets. In existing Azure ELT Tools like Data Factory or Synapse Workbooks, there is the option to authenticate to Key Vault via linked services. Currently, this option is not available in Fabric and there needs to be another way.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">The Issue with Fabric Notebooks<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In Azure, we prefer to use managed identities for authentication. Managed identities provide a secure and streamlined way for applications and services to authenticate and access Azure resources without the need to store or manage credentials. But currently, there is no option to use a managed identity with the Fabric Notebooks. On the <a href=\"https:\/\/learn.microsoft.com\/en-us\/fabric\/release-plan\/admin-governance#ds-connectivity\">Fabric Roadma<\/a><a href=\"https:\/\/learn.microsoft.com\/en-us\/fabric\/release-plan\/\">p<\/a>, Data source connectivity using workspace identity is estimated to release in Q1 2024. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">&#8220;Fabric will support workspace identity to help organizations avoid downtime due to credential expiration and to improve their security for authentication in connectors. You&#8217;ll also be able to configure workspace identity as the authentication method for data sources like Azure SQL DB, Azure Data Lake Storage Gen2 and others, which support AAD authentication. Power BI role-based access control will prevent unapproved use of the workspace identity.&#8221;<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Until then, we need to have a solution to use app credentials but in a secure way. Hardcoding them is not an option and the way to go is to use Key Vault. But how to access Key Vault without a managed identity?<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Solution\">Solution: Implementation<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don&#8217;t have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to <em>read<\/em> the secret in your Vault. Otherwise the retrieval will not work. Simply being the creator of the Key Vault won&#8217;t be enough.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"373\" src=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-11-1024x373.png\" alt=\"\" class=\"wp-image-859\" srcset=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-11-1024x373.png 1024w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-11-300x109.png 300w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-11-768x280.png 768w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-11.png 1141w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Code<\/summary>\n<pre class=\"wp-block-code\"><code># MsSparkUtils has been officially renamed to NotebookUtils, while still backwards compatible, \n# it is strongly recommended upgrading to notebookutils\n\n# # Set the variables for the Key Vault\nsecretName = \"fabric-blog-dummy-password\"\nkeyVaultURL = \"https:\/\/dev-kv-blog.vault.azure.net\/\"\n# Retrieve secret\npswrd = notebookutils.credentials.getSecret(keyVaultURL, secretName)\n\n# DEPRECIATED: Retrieve secret with PyTridentTokenLibrary\n# Import wrapper\n# from trident_token_library_wrapper import PyTridentTokenLibrary\n# Generate access token in current context\n# access_token = notebookutils.credentials.getToken(\"keyvault\")\n# pswrd = PyTridentTokenLibrary.get_secret_with_token(keyVaultURL,secretName,access_token)<\/code><\/pre>\n<\/details>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">After retrieving the secret, printing out the variable does not yield the password itself but a string showing [REDACTED]. This is because Fabric protects the secret from leaking via your console output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"241\" src=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-2.png\" alt=\"\" class=\"wp-image-405\" srcset=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-2.png 877w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-2-300x82.png 300w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-2-768x211.png 768w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\" \/><figcaption class=\"wp-element-caption\">Censored print statement<\/figcaption><\/figure>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Code<\/summary>\n<pre class=\"wp-block-code\"><code># Try to print the retrieved string\nprint(f\"The retrieved password is: {pswrd}\")<\/code><\/pre>\n<\/details>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Despite the printout not showing the actual secret text, the value is stored internally. The secret can be used for example to call an API endpoint. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"307\" src=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-7-1024x307.png\" alt=\"\" class=\"wp-image-743\" srcset=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-7-1024x307.png 1024w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-7-300x90.png 300w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-7-768x230.png 768w, https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/image-7.png 1206w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Code<\/summary>\n<pre class=\"wp-block-code\"><code>#<em> Demo API call with password<\/em>\n# Check https:\/\/dummyjson.com\/docs\/auth for details\n<em>import<\/em> json\n<em>import<\/em> requests\napi_url =\"https:\/\/dummyjson.com\/auth\/login\"\nbody = json.dumps({\"username\": \"emilys\", \"password\": pswrd }) # emilyspass\nheaders = &nbsp;{\"Content-Type\":\"application\/json\"}\nresponse = requests.post(api_url, data=body, headers=headers)\nprint(response)\nprint(response.content)<\/code><\/pre>\n<\/details>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This solution is not perfect and we are eagerly waiting for the update to use workspace identities. But until then, at least there is an option to prevent cleartext passwords in the code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More about Fabric:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.syntera.ch\/blog\/2023\/09\/26\/why-enterprises-using-power-bi-should-be-excited-about-ms-fabric\/\">Why Enterprises using Power BI should be excited about MS Fabric &#8211; Syntera<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.syntera.ch\/blog\/2024\/01\/09\/implementing-fabric-eventstream-data-activator-with-real-world-data\/\">Implementing Fabric Eventstream &amp; Data Activator With Real World Data &#8211; Syntera<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This blog post focuses on how to handle authentication within Fabric Notebooks using secrets without storing them in your code. To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. <\/p>\n","protected":false},"author":3,"featured_media":429,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,25],"tags":[35,36],"class_list":["post-373","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-engineering","category-security","tag-fabric","tag-notebook"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How-To Access Azure Key Vault Secrets from Fabric Notebook - Syntera<\/title>\n<meta name=\"description\" content=\"To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don&#039;t have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to read the secret in your Vault.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How-To Access Azure Key Vault Secrets from Fabric Notebook - Syntera\" \/>\n<meta property=\"og:description\" content=\"To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don&#039;t have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to read the secret in your Vault.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/\" \/>\n<meta property=\"og:site_name\" content=\"Syntera\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-18T16:13:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-16T08:31:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/FabricNotebooks-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dominic Schranz\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dominic Schranz\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/\",\"url\":\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/\",\"name\":\"How-To Access Azure Key Vault Secrets from Fabric Notebook - Syntera\",\"isPartOf\":{\"@id\":\"https:\/\/www.syntera.ch\/blog\/#website\"},\"datePublished\":\"2023-10-18T16:13:39+00:00\",\"dateModified\":\"2025-12-16T08:31:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.syntera.ch\/blog\/#\/schema\/person\/e038d1dcebeca2193c5503f78783988d\"},\"description\":\"To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don't have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to read the secret in your Vault.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.syntera.ch\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How-To Access Azure Key Vault Secrets from Fabric Notebook\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.syntera.ch\/blog\/#website\",\"url\":\"https:\/\/www.syntera.ch\/blog\/\",\"name\":\"Syntera\",\"description\":\"translating data into business value.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.syntera.ch\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.syntera.ch\/blog\/#\/schema\/person\/e038d1dcebeca2193c5503f78783988d\",\"name\":\"Dominic Schranz\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.syntera.ch\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bd3589b8a6ccc62e37c3cee8f8e06c73a4085816337ad7d6c154e30dc60cc4c1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bd3589b8a6ccc62e37c3cee8f8e06c73a4085816337ad7d6c154e30dc60cc4c1?s=96&d=mm&r=g\",\"caption\":\"Dominic Schranz\"},\"url\":\"https:\/\/www.syntera.ch\/blog\/author\/domi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How-To Access Azure Key Vault Secrets from Fabric Notebook - Syntera","description":"To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don't have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to read the secret in your Vault.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/","og_locale":"en_US","og_type":"article","og_title":"How-To Access Azure Key Vault Secrets from Fabric Notebook - Syntera","og_description":"To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don't have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to read the secret in your Vault.","og_url":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/","og_site_name":"Syntera","article_published_time":"2023-10-18T16:13:39+00:00","article_modified_time":"2025-12-16T08:31:44+00:00","og_image":[{"width":1024,"height":720,"url":"https:\/\/www.syntera.ch\/blog\/wp-content\/uploads\/2023\/10\/FabricNotebooks-1.jpg","type":"image\/jpeg"}],"author":"Dominic Schranz","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dominic Schranz","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/","url":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/","name":"How-To Access Azure Key Vault Secrets from Fabric Notebook - Syntera","isPartOf":{"@id":"https:\/\/www.syntera.ch\/blog\/#website"},"datePublished":"2023-10-18T16:13:39+00:00","dateModified":"2025-12-16T08:31:44+00:00","author":{"@id":"https:\/\/www.syntera.ch\/blog\/#\/schema\/person\/e038d1dcebeca2193c5503f78783988d"},"description":"To access Key Vault from a Fabric Notebook, use the PyTridentTokenLibrary to handle the call while using an access token. Specify the name of the secret in Key Vault and provide the URL of the Vault. If you don't have a Key Vault, you need to create one in your Azure tenant. Double check that the current user has the permissions to read the secret in your Vault.","breadcrumb":{"@id":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.syntera.ch\/blog\/2023\/10\/18\/how-to-access-azure-key-vault-secrets-from-fabric-notebook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.syntera.ch\/blog\/"},{"@type":"ListItem","position":2,"name":"How-To Access Azure Key Vault Secrets from Fabric Notebook"}]},{"@type":"WebSite","@id":"https:\/\/www.syntera.ch\/blog\/#website","url":"https:\/\/www.syntera.ch\/blog\/","name":"Syntera","description":"translating data into business value.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.syntera.ch\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.syntera.ch\/blog\/#\/schema\/person\/e038d1dcebeca2193c5503f78783988d","name":"Dominic Schranz","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.syntera.ch\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/bd3589b8a6ccc62e37c3cee8f8e06c73a4085816337ad7d6c154e30dc60cc4c1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bd3589b8a6ccc62e37c3cee8f8e06c73a4085816337ad7d6c154e30dc60cc4c1?s=96&d=mm&r=g","caption":"Dominic Schranz"},"url":"https:\/\/www.syntera.ch\/blog\/author\/domi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/posts\/373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/comments?post=373"}],"version-history":[{"count":36,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/posts\/373\/revisions"}],"predecessor-version":[{"id":1021,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/posts\/373\/revisions\/1021"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/media\/429"}],"wp:attachment":[{"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/media?parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/categories?post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syntera.ch\/blog\/wp-json\/wp\/v2\/tags?post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}