Hi Lotus88 This kind of issue usually shows up because notebooks run differently depending on how they’re triggered.
When you run it manually, it uses your own Microsoft Entra ID (formerly Azure AD), which has access to the Key Vault.
But when the notebook runs from a pipeline, it uses the Synapse workspace's managed identity, and that identity must have the right permissions and be able to acquire a token for the Key Vault. That’s likely where it’s failing.
The error message about not being able to acquire MSI for a Vault usually points to one of these common causes:
Things to Check
Managed Identity: Ensure the system-assigned managed identity is turned on for your Synapse workspace (Azure Portal → Synapse → Identity → System-assigned = On).
Vault Name in Code: Double-check the Key Vault name you're passing in the code. It should be the actual resource name not an alias or display name:
mssparkutils.credentials.getSecret('kv-002', 'secret-user')
Key Vault Networking: If you're using firewall rules or private endpoints, your Synapse workspace might not be able to reach the vault.
As a quick test, set the Key Vault to "Allow access from all networks" to rule out network restrictions.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.