Forum Discussion

evrise's avatar
evrise
Advocate II
2 years ago

Environments (preview): how to define env variables?

Sorry for so stupid question. But I am not sure how to setup environment variables for Spark notebook/jobs. I thought Environments should solve this, but do not know how. Whats your approach ? 

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi evrise 
    Thanks for using Fabric Community.
    You can use the below code in your notebook to set the environment variable.

    import os
    os.environ['NAME_OF THE_ENVIRONMENT'] = 'true'


    Hope this helps. Please let me know if you have any further questions.

  • I am sorry, but no. This is not a solution. Notebook is in 99,9% consumer of env. variables.

    But maybe I am completely lost here. I would expect Environment is for setting envs. 

    How your solution looks like ? Ho do you write envs. for whole workspace when deploying notebooks from one env to another ? This seems to me you have hardcoded it in the notebook and its totally useless. Thanks for explanation. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi evrise 

      Thanks for the explaination. Currently environment variables are not supported in Fabric yet. 

      Appreciate if you could share the feedback on our feedback channel. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.

      Hope this helps. Please let me know if you have any further queries.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi evrise 
        We havenโ€™t heard from you on the last response and was just checking back to see if your query got resolved. Otherwise, will respond back with the more details and we will try to help.
        Thanks