Skip to content
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

AzureCliCredential cannot find az on windows (10?) #11

Closed
gzp79 opened this issue Oct 9, 2020 · 0 comments · Fixed by #12
Closed

AzureCliCredential cannot find az on windows (10?) #11

gzp79 opened this issue Oct 9, 2020 · 0 comments · Fixed by #12

Comments

@gzp79
Copy link
Contributor

gzp79 commented Oct 9, 2020

rust Command cannot find az command on (some) windows systems. Most certainly it is related to how command is implemented:
see rust-lang/rust#42791 and https://doc.rust-lang.org/nightly/std/process/struct.Command.html.

I think az is az.cmd on windows and it should be called with cmd /c

let az_command = Command::new("cmd")
            .args(&[
                "/C",
                "az",
                "account",
                "get-access-token",
                "--output",
                "json",
                "--resource",
                resource,
            ])
            .output();
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant