chore: add debug output and logging

This commit is contained in:
Bart van der Braak 2023-11-25 18:17:17 +01:00
parent 068e4063fc
commit b7b2a3de6a

View file

@ -12,22 +12,24 @@ static FIREWALL_KEYVAULT: &str = "bvdbkeyweavetweukvt2";
static NON_EXISTENT_KEYVAULT: &str = "bvdbkeyweavetweukvt3";
fn azure_cli_login(client_id: String, tenant_id: String, subscription_id: String) -> Result<(), std::io::Error> {
Command::new("az")
println!("Executing 'az login' with client ID: {}", client_id);
let login_output = Command::new("az")
.arg("login")
.arg("--identity")
.arg("--username")
.arg(client_id)
.arg(&client_id)
.arg("--tenant")
.arg(tenant_id)
.arg(&tenant_id)
.output()?;
Command::new("az")
println!("Login output: {:?}", login_output);
println!("Executing 'az account set' with subscription ID: {}", subscription_id);
let account_output = Command::new("az")
.arg("account")
.arg("set")
.arg("--subscription")
.arg(subscription_id)
.arg(&subscription_id)
.output()?;
println!("Account output: {:?}", account_output);
Ok(())
}