官术网_书友最值得收藏!

Installing the Azure CLI and Azure PowerShell module

In order to manage Azure resources efficiently from the command line, it is recommended to use the official Azure CLI. The official installation notes can be found at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest. Let's get started:

  1. Installing the Azure CLI from PowerShell requires running the following commands as an Administrator:
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi
Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'
Remove-Item .\AzureCLI.msi
  1. After installing the Azure CLI, you need to restart your PowerShell window. Next, log in to your Azure account:
az login

The preceding command will open your default browser and instruct you to log in to your Azure account.

  1. Now, run the following command to verify that you have been logged in properly:
az account show

You should be able to see your subscription details, similar to this:

On top of that, we need to install the Azure PowerShell module since some operations are not available in the Azure CLI.

  1. Installation for the currently logged-in user can be performed using the following command:
Install-Module -Name Az -AllowClobber -Scope CurrentUser

The official installation steps can be found here: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-2.5.0#install-the-azure-powershell-module-1.

  1. If you run into problems while importing the newly installed module, you'll also need to set a PowerShell execution policy to RemoteSigned as an Administrator:
Set-ExecutionPolicy RemoteSigned

  1. Logging in to Azure using the PowerShell module has to be done separately from the Azure CLI and can be performed using the following command:
Connect-AzAccount

At this point, you should be able to manage your resources using the Azure CLI and the Azure PowerShell module, without opening the Azure Portal website! Let's take a look at how to create an Azure Files SMB share.

主站蜘蛛池模板: 中江县| 河津市| 华蓥市| 瓮安县| 阿城市| 丽江市| 道孚县| 株洲市| 洱源县| 平邑县| 大石桥市| 溆浦县| 南城县| 花莲县| 临颍县| 吕梁市| 英吉沙县| 京山县| 大姚县| 苍山县| 临高县| 岑巩县| 舒城县| 大连市| 寿宁县| 铜梁县| 秦安县| 大关县| 连州市| 儋州市| 安福县| 禹城市| 天津市| 阿合奇县| 迭部县| 孟津县| 勃利县| 简阳市| 嘉义县| 开化县| 甘德县|