When migrating from environment variables to Julep secrets:
Create a list of all environment variables used in your application
Create corresponding secrets in Julep with the same names
Update your code to reference Julep secrets instead of environment variables
Validate functionality before removing the original environment variables
Migration script example:
Copy
import osfrom julep import Julepclient = Julep(api_key="your_api_key")# List of environment variables to migrateenv_vars_to_migrate = [ "OPENAI_API_KEY", "STRIPE_SECRET_KEY", "DATABASE_URL", "AUTH_TOKEN"]# Migrate each environment variable to a Julep secretfor env_var in env_vars_to_migrate: value = os.environ.get(env_var) if value: try: client.secrets.create( name=env_var.lower(), # Convert to snake_case value=value, description=f"Migrated from environment variable {env_var}" ) print(f"Successfully migrated {env_var} to Julep secret") except Exception as e: print(f"Failed to migrate {env_var}: {e}") else: print(f"Environment variable {env_var} not found")