Join Bhargav Shukla for an in-depth discussion in this video Installation of Azure CLI, part of Microsoft Azure: Create a Linux Virtual Machine.
Before I can connect to Microsoft Azure, I need to install a few tools. These prerequisites will allow me to connect to an existing Azure subscription and carry out necessary tasks to create and manage a Linux Virtual Machine in Azure. The Azure Command-Line Interface is a set of open-source shell-based commands that allows me to manage an Azure subscription and create and manage Azure resources, such as resource groups, storage, networking, and virtual machines. The cross-platform tool set can be installed on Linux, macOS, and Windows.
Before I can install Azure CLI Version 2, I need to download and install Python 3.5.2 or later. The other installer updates the path variable. It doesn't add the user profile path, which is required for Azure scripts to work. Update the variable after Python is installed. Once the Python is installed and path variable updated, I can install Azure CLI using the command pip installed. So let's go ahead and install Python and Azure CLI.
I have browsed to Python Releases for Windows. From here, I am going to download Windows 64-bit executable installer. And I will select the Run option. I will accept the default and select Add Python 3.6 to PATH, and click Install. When prompted for user account control, you need to provide administrator permission. I will select Yes, here. After the installation is successful, I will select disable the PATH length limit so that Python can bypass 260-character PATH limitation.
I will select Yes for the user account control again. And now, we have the Python installation complete. Now that the installation is complete, I am going to update the path. From the Settings, I will edit the environment variables. And in the Environment Variables windows, I will select the user variables. The variable we need to edit is called Path. The path we need to add is the Python scripts for the users roaming folder.
We will copy the existing path and we will add a new path, where we will edit the local to roaming. And the correct path does not include programs. Now, I have added the required paths to the variables. This will allow the Azure scripts to run. Now, I can launch the PowerShell window and install Azure CLI.
From PowerShell window, I will install Azure CLI using the command pip install. Now that the Azure CLI is installed, we can use the Azure CLI to issue the Azure commands and manage Azure subscription and resources.
- Installing Azure CLI
- Creating Virtual Network (VNet) and storage accounts
- Creating a custom Linux image
- Deploying a Linux virtual machine from Azure Marketplace
- Using VM Agent