Forum Discussion
dolphinantonym
1 year agoHelper I
Using Key Vault secrets in Notebooks from Workspace identities
My Workspace has an identity that is allowed to access a Key Vault that contains secrets for accessing an API. When I try and access the secret from Notebooks (using notebookutils.credentials.get...
dolphinantonym
1 year agoHelper I
youdao4 wrote:
🧠Use TokenLibrary.getAccessToken() instead:
If notebookutils.credentials.getSecret() isn’t using the Workspace identity, it’s likely falling back to your user context. Try using this method instead:
from notebookutils import mssparkutils
token = mssparkutils.credentials.getToken("https://vault.azure.net")Can you elaborate on that? You mention using getAccessToken but then the example uses getToken(). In either case, do I need to provide an argument for the name of the secret as with getSecret()?
dolphinantonym
1 year agoHelper I
The whole problem is that I can't retrieve tokens from the Key Vault, because the Notebook uses my identity - which doesn't have access to the Key Vault - rather than the Workspace identity, which does have access.