- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 278字
- 2021-06-24 16:54:02
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:
- 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
- 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.
- 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.
- 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.
- 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
- 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.
- C及C++程序設計(第4版)
- Git Version Control Cookbook
- C語言程序設計習題解析與上機指導(第4版)
- Flink SQL與DataStream入門、進階與實戰
- Apache Spark 2 for Beginners
- 基于差分進化的優化方法及應用
- Bootstrap Essentials
- Windows Presentation Foundation Development Cookbook
- JAVA程序設計實驗教程
- Odoo 10 Implementation Cookbook
- Python編程:從入門到實踐(第3版)
- Advanced UFT 12 for Test Engineers Cookbook
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- 大學計算機基礎
- Android Studio開發實戰:從零基礎到App上線 (移動開發叢書)