-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure environment variables works for child files. #2201
Conversation
/azp run |
can this be added as integration test? |
Maybe bit tricky as we dont have any test structure in the pipelines right now that can take 2 config files. Given dab's ga deadline and we want this fix to go in, maybe better to invest in that testing all up for multi-db post GA. |
/azp run |
PR description needs more details.
Need to open issue to track adding a test: here are some notes for whoever picks it up:
|
/azp run |
Why make this change?
When we are loading child config files, we were not setting replace env variable to true and hence child config environment variables were not being obeyed. This meant that when users were using @env('variable') instead of searching for the environment variable, the code took @env('vairable') as the literal string. This fix ensures that environment variables can be used for multi-db scenario.
You need to add in parent config a data-source-files referencing a child config with connection string referencing a env variable:
"data-source": {
"database-type": "mssql",
"connection-string": "@env('my-connection-string')",
"options": {
"set-session-context": true
}
},
"data-source-files": [ "dab-config-dab.json" ]
"data-source": {
"database-type": "mssql",
"connection-string": "@env('my-connection-string-dab')",
"options": {
"set-session-context": true
}
},
What is this change?
Adding true to runtimeconfig file.
How was this tested?
Ran an integration test with two config files and an environment variable in the child file.