Within the Morph framework, you can utilize environment variables to build and deploy data applications.

Accessing environment variables can be done in the same way as in regular Python code.

import os
import pandas as pd
import morph
from morph import MorphGlobalContext

@morph.func
def get_env_value(context: MorphGlobalContext):
    # get env variable named "ENV_NAME"
    env_name = os.environ["ENV_NAME"]
    return pd.DataFrame({})

Setting Environment Variables

morph sync command automatically synchronizes local environment variables to the cloud version.

You can register environment variables from the “Data” tab in the Editor mode.