Azure CLI and Powershell
az login --tenant <tenant id>
az account set --subscription <subscription id>
Connect-AzAccount Get-AzSubscriptions Set-AzContext
$AzCred = Get-Credential -UserName <username> az login -u $AzCred.UserName -p $AzCred.GetNetworkCredential().Password
$key = “HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds” Set-ItemProperty $key ConsolePrompting True Get-Credential Set-ItemProperty $key ConsolePrompting False
az login az account set --subscription <subscription id> Start-Job -ScriptBlock {az network bastion rdp --name <bastion name> --resource-group <resource group name> --target-resource-id <resource id>}
read -sp "Azure user: " AZ_USER && read -sp "Azure password: " AZ_PASS && echo && az login -u $AZ_USER -p $AZ_PASS