Please make sure you input the correct subscription id value when you run az account set -s and other parameters values via echo the environment variable value. You can also get a list of subscriptions for the logged-in account with the command az account list and check if the subscription Id does exist in the specific tenant.The subscription information with isDefault: true is the currently activated subscription after logging in. To select another subscription, use the az account set command with the subscription ID to switch to. For more information about subscription selection, see Use multiple Azure subscriptions.
# See what subscription you are currently using. az account show # Get a list of available subscriptions. az account list --output table # If the subscription you are seeking is not in the list # close and reopen your terminal window, # or logout and then sign in again. az logout az login # Did your available subscription list
az login az account set --subscription az network bastion rdp --name Test-vnet-bastion --resource-group TestRG --target-resource-id From the command above, the less obvious information needed is the VM Resource ID. To get that, you can either run a PowerShell command or use the Azure Portal. Pick the subscription you want and use it in the command below. az account set --subscription . az account set (--name or -n) az account set (--subscription or -s) . Use id (subscription id) that is GUID, which will be listed when you did az login. And then execute the below command.. m1hT.