How to fetch environmental variables saved in one notebook into another notebook in Databricks Repos and Notebooks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 10:30 PM
I have this config.py file which is used to store environmental variables
PUSH_API_ACCOUNT_ID = '*******'
PUSH_API_PASSCODE = '***********************'
I am using this to fetch the variables and use it in my file.py
import sys
sys.path.append("..")
from folder import config
# create header for push API
headers = {
'Account-Id': PUSH_API_ACCOUNT_ID,
'Passcode': PUSH_API_PASSCODE,
'Content-Type': 'application/json',
}
#Push API url
url = "https://fetch.api.netscape.news.com/1/send/push.json"
#call API
response = requests.request("POST", url, headers=headers, data = data)
How to do it in Repos and Workspace section
Labels:
- Labels:
-
Databricks Repos
-
File
-
Notebook
1 REPLY 1

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 08:27 AM
Hey there @Shubham Biswas
Hope all is well!
Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!

