-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add ability to load azd env vars into shell #4078
base: main
Are you sure you want to change the base?
Conversation
@pamelafox - Once we get a build of azd for this PR can you try it out to see if that helps with your env path scenario? |
@pamelafox - I also added a new export option to get-values that allows you to eval and set the context. For example:
will output:
So, you can now do: source <(azd env get-values -o export)
python.py app.py
And that will display the value from the python app.
I'm thinking this will work well for apps that have a startup script like a package.json or a python setup file. I think this will do away with this type of code: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/scripts/load_azd_env.sh |
I would be too afraid to use the -export option, as I keep getting into nasty situations due to lingering exported environment variables from previous exports (like from load_azd_env). I'm trying to move away from export in all the repos now. |
I've tried this out, and it works well for the positive case, but for the case that nothing satifies the JMESpath query, it seems to give back the string "null" as a result. Is that expected? Feels a bit odd. |
I'd like to hear more details on what you are facing with exports. |
@jongio When I export the whole environment, and then I do an "azd env set" to another environment, the previous env variables are still around, so my subsequent actions are affected by anything that was set there (particular anything that main.parameters.json or my hooks use). I have to then explicitly unset every variable to get things back to a clean state. |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Hi @jongio. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Fixes #4067
Currently adds -o export to get-values. We are evaluating other methods / interfaces as well.