-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Bug]: env() transformation does not work after upgrading the project from 0.7.6 to 0.9.7 #1956
Comments
@anielii, Thanks for pointing out. I checked it and found out replace environment variable is not working for WORKAROUND: |
Having a look at it and the problem seems to stem from the late-bound deserialization of the options for a data source, which happens here: data-api-builder/src/Config/ObjectModel/DataSource.cs Lines 25 to 48 in dacf3bc
This is late-bound because the The side effect of this is that when we get the string value for the options we don't use the deserialization pipeline, meaning the A relatively simple solution would be to make the code that takes a string value and returns it or the env replaced version and make a new method (probably an
Then the data-api-builder/src/Config/ObjectModel/DataSource.cs Lines 50 to 58 in dacf3bc
and call that new method with the result of An alternative approach would be to create a |
…1980) ## Why make this change? - Closes #1956 - Data source section was not supporting env transformation. ## What is this change? - Added a DataSourceConverterFactory which will properly deserialize the data-source section considering the _replaceEnvVariable to decide weather to transform or not. ## How was this tested? - [X] Unit Tests --------- Co-authored-by: Sean Leonard <sean.leonard@microsoft.com> Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
…ce options #1980 (#2016) // only diff is excluded changes from mutationtests.cs for Cosmos that only exists in .11+. via #1893 ## Why make this change? - Closes #1956 - env variable replacement not happening in the `options` section of `data-source` property in our config. ## What is this change? - Added a DataSourceConverterFactory which will properly deserialize the data-source section considering the _replaceEnvVariable to decide weather to transform or not. ## How was this tested? - [X] Unit Tests --------- Co-authored-by: Abhishek Kumar <102276754+abhishekkumams@users.noreply.github.com>
What happened?
Hi,
After upgrading my project from
0.7.6
to0.9.7
, the @env() transformation stopped working. The environment variables are not replaced at all. I have the same problem both locally (CLI update) and in Azure ContainerApps (image update).In the past, for
0.7.6
, when I was developing locally, I set the environment variables in the terminal in the following way and everything worked fine without any problems. I get the same problem when I try to use the.env
file.Is there a new undocumented option to enable environment variable replacement?
dab-config.json:
Version
0.9.7
What database are you using?
CosmosDB NoSQL
What hosting model are you using?
Local (including CLI), Container Apps
Which API approach are you accessing DAB through?
REST, GraphQL
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: