I'm in need of updating the secrets using the notebook rather than CLI. So I'm using APIs and everytime I fetch new access token and refresh token I want to update them in my databricks backed secret scope.
I'm using this command dbutils.secrets.put but it does not work. Throws the error
‘SecretHandler’ object has no attribute put
Do I need to activate something in dbuitls or why this is not possible from notebook?
If not this, is it possible to update secrets in KeyVault backed secret scope?



Databricks secret scope can only read secrets from Azure Key vault, and has only Get and List commands. Documentation - https://learn.microsoft.com/en-us/azure/storage/blobs/assign-azure-role-data-access?tabs=portal .
You can use Azure CLI to update secrets - https://learn.microsoft.com/en-us/azure/key-vault/general/quick-create-cli
And this answer talk about ho to use the Azure CLI with Python, so it should work on Databricks - https://stackovewrflow.com/questions/51546073/how-to-run-azure-cli-commands-using-python