Forum Discussion

jbreunung's avatar
jbreunung
Frequent Visitor
2 years ago
Solved

Change default Lakehouse with notebookutils

We are currently trying to find a solution for our development process. If we use git with branches to transport notebooks between environments, the default lakehouse information is still pointing t...
  • abm_chris's avatar
    abm_chris
    2 years ago

    Yeah I understand what you're saying but once you've configured it once it's not a problem, just have to remember to do it on the first time you add the notebook to the 'prod' workspace.

    It's just a flat json file stored in OneLake so any config settings I need are hidden away from users. I just use the below to get the name of the current notebook which will map to one of the elements in the file.

    nb_name = mssparkutils.runtime.context['currentNotebookName']