Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
azure:qnd:azure_cli [2022/06/09 18:51] – [Powershell] mgupton | azure:qnd:azure_cli [2022/10/31 18:12] (current) – [Azure CLI] mgupton | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Azure CLI ====== | ====== Azure CLI ====== | ||
+ | Azure CLI and Powershell | ||
+ | |||
+ | * [[https:// | ||
+ | |||
+ | <code powershell> | ||
+ | az login --tenant <tenant id> | ||
+ | </ | ||
+ | |||
+ | <code powershell> | ||
+ | az account set --subscription < | ||
+ | </ | ||
+ | |||
====== Powershell ====== | ====== Powershell ====== | ||
- | Login (via GUI prompt) | + | ===== Login Sequence ===== |
+ | < | ||
+ | Connect-AzAccount | ||
+ | Get-AzSubscriptions | ||
+ | Set-AzContext | ||
+ | </ | ||
+ | |||
+ | === Login (via GUI prompt) | ||
<code powershell> | <code powershell> | ||
$AzCred = Get-Credential -UserName < | $AzCred = Get-Credential -UserName < | ||
Line 7: | Line 26: | ||
</ | </ | ||
- | Login from command line | + | === Login from command line === |
<code powershell> | <code powershell> | ||
$key = “HKLM: | $key = “HKLM: | ||
Line 14: | Line 33: | ||
Set-ItemProperty $key ConsolePrompting False | Set-ItemProperty $key ConsolePrompting False | ||
</ | </ | ||
+ | |||
+ | === Use native client with bastion === | ||
+ | <code powershell> | ||
+ | az login | ||
+ | az account set --subscription < | ||
+ | Start-Job -ScriptBlock {az network bastion rdp --name <bastion name> --resource-group < | ||
+ | </ | ||
+ | |||
+ | |||
====== Bash ====== | ====== Bash ====== | ||
=== Login === | === Login === |