Skip to content

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

Closed
@gzp79

Description

@gzp79

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions