How can we help you today? How can we help you today?

flyway.jdbcProperties do not always get used

Trying to use flyway with snowflake. Below (Sample A) is example showing what we are trying to do to connect with private_key_file. This doesn't seem to work. It only seems to work if we put the private_key_file setting directly into the url.

Its pretty frustrating, plus it also means that you can't have a single toml file that will work with PAT or public/private key

Sample A
…..
[flyway.jdbcProperties]
user="${FLYWAY_USER}"
private_key_file="/flyway/privatekey.p8"

## Environment: Dev
[environments.dev]
url = """jdbc:snowflake://XXXXXX.snowflakecomputing.com?\
warehouse=DEV_XXXXXX_WH&\
db=DEV_XXXXXX_DB&\
role=DEV_XXXXXX_ROLE&\
jdbc_query_result_format=JSON"""


Sample B
…..
[flyway.jdbcProperties]
user="${FLYWAY_USER}"

## Environment: Dev
[environments.dev]
url = """jdbc:snowflake://XXXXXX.snowflakecomputing.com?\
warehouse=DEV_XXXXXX_WH&\
db=DEV_XXXXXX_DB&\
role=DEV_XXXXXX_ROLE&\
private_key_file=/flyway/privatekey.p8&\
jdbc_query_result_format=JSON"""
 

Benjamin Peikes
0

Comments

1 comment

  • Dan Calver
    Official comment

    Hi Benjamin,

    In this case, scenario B works because Snowflake will only consume the private_key_file when it's part of the JDBC URL. 

    Does the private_key_file need to be variable?

    I would try something like the following

    ## Environment: Dev
    [environments.dev]
    url = """jdbc:snowflake://XXXXXX.snowflakecomputing.com?{$private_key_file_variable}\

    Then you can set up your private_key_file as an environmental variable.

    Dan Calver

Add comment

Please sign in to leave a comment.