Skip to content

Is there a way to reference environment variables in connections.toml #328

@ReinierKop

Description

@ReinierKop

What are you trying to accomplish?
I am trying to integrate SchemaChange into our dagster/dbt/snowflake stack. We use dotenv to manage our configurations across dev/test/staging/ci/prod, so I'd like to be able to reference environment variables throughout our stack.

Specifically, I'd like to be able to specify environment variables in connections.toml, but my attempts to do so so far have failed, and I've not seen examples in the issue history nor the documentation that tell me how and if I can do this.

What options have you tried so far?

I have a connections.toml file like this:

[myconnection]
account = "${SNOWFLAKE_ACCOUNT}"
user = "${SNOWFLAKE_USER}"
password = "${SNOWFLAKE_PASSWORD}"
warehouse = "${SNOWFLAKE_WAREHOUSE}"
database = "${SNOWFLAKE_DATABASE}"

I then run schemachange -f migrations --connections-file-path ./connections.toml --connection-name myconnection

Expectation: connected successfully to our snowflake warehouse.
Reality: 404 Not Found: post https://${SNOWFLAKE_ACCOUNT}.snowflakecomputing.com:443/session/v1/login-request? .... (error truncated).

I've also tried this with environment variables formatted as "$SNOWFLAKE_ACCOUNT"

Hope someone can point me in the right direction, this seems rather trivial and I am sure I am missing something :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    WorkaroundIssues that can be addressed via a workaroundquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions