If azd is intended to be consumed by other software/tooling as part of automation, we need to produce predictable clean output as part of some well-defined contract.
For example, perhaps we intend that any software tooling that consumes azd should pass --output json for a deterministic output. If so, anytime a command has --output json format specified, the only output logged to stdout should either be:
- The successful result as JSON
- An error message describing the failure (non-JSON)
Info/warning messages that are emitted as part of the command that would usually serve to provide user feedback should be suppressed.
If we can define this logic cleanly, we would be able to increase user feedback where needed without breaking contracts for software consumers. An example would be a login attempt message that occurs with all commands, but only when allowed.
This would also be a chance to clean up existing output where we might have muddied the contract for a software consume. For example, currently parsing the result of azd version might be problematic when azd is out-of-date, and additional stdout output message is generated for the version warning:
PS D:\repos\azd-sources\test> azd version
azd version 0.0.0-dev.1 (commit 0000000000000000000000000000000000000000)
warning: your version of azd is out of date, you have 0.0.0-dev.1 and the latest version is 0.1.0-beta.1
To update to the latest version, run:
powershell -c "Set-ExecutionPolicy Bypass Process -Force; irm 'https://aka.ms/install-azd.ps1' | iex"
If
azdis intended to be consumed by other software/tooling as part of automation, we need to produce predictable clean output as part of some well-defined contract.For example, perhaps we intend that any software tooling that consumes
azdshould pass--output jsonfor a deterministic output. If so, anytime a command has--output jsonformat specified, the only output logged tostdoutshould either be:Info/warning messages that are emitted as part of the command that would usually serve to provide user feedback should be suppressed.
If we can define this logic cleanly, we would be able to increase user feedback where needed without breaking contracts for software consumers. An example would be a login attempt message that occurs with all commands, but only when allowed.
This would also be a chance to clean up existing output where we might have muddied the contract for a software consume. For example, currently parsing the result of
azd versionmight be problematic whenazdis out-of-date, and additionalstdoutoutput message is generated for the version warning: