- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 989 Articles for Software & Coding
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
546 Views
To find the location of the particular Azure VM using Az CLI, we can use the below command but before that, you need to make sure you are connected to the Azure cloud and had set that specific subscription.PS C:\> az vm show -n VMName -g ResourceGroupName --query '[location]' -otsvAlternatively, you can use the below command to get the location of the Azure VM.PS C:\> az vm list --query "[?name==’VMName’].location" -otsv
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
1K+ Views
To get the Azure VM size using Azure CLI, we first need to make sure that the Azure account is connected to the specific subscription for the VM that we need to retrieve the VM size.To get the specific Azure VM size, we need to first retrieve the VM details and then need to run the JMESPATH query to retrieve the VM size.az vm show -n VMname -g ResourceGroupName --query '[hardwareProfile.vmSize]' -otsvyou can also retrieve the size of the VM without resource group name, using “az vm list” command.az vm list --query "[?name=='AzVM'].hardwareProfile.vmSize" -otsvRead More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
7K+ Views
To list all the Azure VMs connected to the particular subscription, we need to use the “Az vm” command. Before that, we need to make sure the Azure is connected to the desired subscription, if not use the below command to set the Azure Subscription.az account set -s 'subscription name or id'Once the Azure subscription is set, we can use the below command to retrieve the Azure VMs.PS C:\> az vm list -otableTo get the particular azure VM using CLI, we need to provide the VM name and resource group name.PS C:\> az vm show -n VmName -g ResourceGroupName -otable“az ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
8K+ Views
To get all the Azure resource groups connected to the particular subscription use the az group command.Before using this command make sure you are connected with the Azure account and if not connect the azure account with the “Az login”Once you are connected to the Azure account, set the subscription name for which you want to retrieve the resource groups.az account set --subscription 'subscription name or id'Once you have set the subscription, use the below command to retrieve all the resource groups.PS C:\> az group list -otableTo get the particular resource group details, use the below command.PS C:\> az group ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
8K+ Views
To connect to the specific azure subscription using Az CLI we need to use “Az account set” command but before using this command make sure you are connected with the Azure cloud using “az login” account.az account set --subscription 'subscription name or id'You can also use -s instead of --subscription.az account set -s 'subscription name or id'To check if the subscription is set properly, use the below command.PS C:\> az account show -otable
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
9K+ Views
To get the connected user account with the Azure CLI, you need to use the below command.PS C:\> az account showOnce you type the command, you will get the output in JSON format as shown below.PS C:\> az account show { "environmentName": "AzureCloud", "homeTenantId": "Your tenant ID", "id": "Subscriptio ID", "isDefault": true, "managedByTenants": [], "name": "Subscription Name", "state": "Enabled", "tenantId": "tenant ID", "user": { "name": "user logged in email id or username", "type": "user" } }To get the output in the table format, use the -otable or –output tablePS C:\> az account show -otable
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
6K+ Views
To install the Azure CLI, you can download it from the location below,https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli/To install the Azure CLI using PowerShell, use the below command.Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows - OutFile .\AzureCLI.msi Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet' rm .\AzureCLI.msiTo check if the Az CLI is installed successfully run the Az in the cmd or the PowerShell.
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
646 Views
To get the Azure VM sizes using PowerShell, we can use the Get-AzVmSize command.To get all the supported Azure VM sizes as per location, use the below command.PS C:\> Get-AzVMSize -Location EastusOutputTo get available and supported size for the existing virtual machine, use the below command.Get-AzVMSize -ResourceGroupName ResourceGroup1 -VMName TestVM
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
468 Views
To get the Application security groups of the Azure VM using PowerShell, we need to first get the Network Interface of the Azure VM.The below command will retrieve the NIC name of the Azure VM.PS C:\> $vm = Get-AzVM -Name TestVM $nic = (($vm.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1]Once we have the NIC name, we can use the Get-AzNetworkInterface command to retrieve the NIC information and the Security group.The below command will retrieve the application security group names using PowerShell.PS C:\> $nicsettings = Get-AzNetworkInterface -Name $nic $nicsettings.IpConfigurations.ApplicationSecurityGroups
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
436 Views
To get the load balancers attached to the Azure VM using PowerShell, we first need to retrieve the Azure VM network settings. For example, we have an Azure VM name “TestVM” and we willPS C:\> $vm = Get-AzVM -Name TestVM $nic = (($vm.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1]Once we have the network interface name, we need to retrieve the load balancer settings, and to get the Load Balancer settings we need to use the Get-AzNetworkInterface command.PS C:\> $nicsettings = Get-AzNetworkInterface -Name $nicThe below command will retrieve the load balancer name.(($nicsettings.IpConfigurations.LoadBalancerBackendAddressPools.id).Split('/'))[-3]To get the Load Balancer backend pool name, use the below command.(($nicsettings.IpConfigurations.LoadBalancerBackendAddressPools.id).Split('/'))[-1]Overall Script −$vm = Get-AzVM ... Read More