Forum Discussion
Using Key Vault secrets in Notebooks from Workspace identities
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()?
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.
- Natalie_iTalent1 year agoAdministrator
Hello dolphinantonym,
Answers to this thread that were inaccurate were removed from the thread.
Feel free to message me if you have questions.
Best,
Natalie H.
Community Manager