Add azd script run command#4131
Conversation
|
A few thoughts here:
Referenced discussion: |
| script.Interactive = true | ||
|
|
||
| sra.configureScriptFlags(script.Windows) | ||
| sra.configureScriptFlags(script.Posix) | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func (sra *scriptsRunAction) configureScriptFlags(script *ext.HookConfig) { | ||
| if script == nil { | ||
| return | ||
| } | ||
|
|
||
| script.Interactive = true |
There was a problem hiding this comment.
Read interactive from the config
| templatesActions(root) | ||
| authActions(root) | ||
| hooksActions(root) | ||
| scriptsActions(root) |
There was a problem hiding this comment.
Don't require an env to run a script.
|
Does this mean anything I want to run in this manner has to be added to Part of me wonders if there should instead be something like When run with no arguments, it just dumps you into a shell with environment variables. We could also support things like:
You could also imagine I know there was some concern about exposing this idea as |
That would be nice! For now, I added the hook config as parameters, added to this PR desc as well. |
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. |
|
Hi @jongio. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass. |

Users need to be able to run arbitrary scripts and start applications with azd env vars loaded.
This PR add a new command
azd script runthat will run any script defined in azure.yaml with azd env vars loaded.Here's how it works:
azure.yamlRun with
azd script run printenvazd script run start.These scripts will have all azd env vars loaded.
So you can access the vars as usual:
Docker compose
You can also use this to launch docker compose with azd env vars:
and then
azd script run dockerapp_server.py
Dockerfile
docker-compose.yml
Parameters
You can also supply all of the hook parameters via the command line instead of in azure.yaml.
For example:
azd script run --run 'docker compose up --build'