【问题标题】:Can we connect to AzureResourceGroup from Power shell running on a Local Machine instead of running it on the azure portal我们可以从在本地计算机上运行的 Powershell 连接到 AzureResourceGroup,而不是在 azure 门户上运行吗
【发布时间】:2018-05-10 13:05:34
【问题描述】:

通常我们在 Azure 门户上运行 Azure Power shell 命令。但是我们可以通过连接到 Azure 资源组以任何方式在本地计算机的 powershell 窗口上运行相同的 azure powershell 命令吗

【问题讨论】:

    标签: powershell azure azure-resource-group


    【解决方案1】:

    在要连接到 Azure 的 Windows 机器上安装 AzureRM 模块。

    Azure PowerShell v.5.0.1

    Install and configure Azure PowerShell - Microsoft.com

    Install-Module -Name AzureRM
    

    然后使用Connect-AzureRmAccount cmdlet 连接到 Azure。

    $Credential = Get-Credential
    Connect-AzureRmAccount -Credential $Credential
    

    Connect-AzureRmAccount - Microsoft.com

    【讨论】:

    • 谢谢@Vincent K。这篇文章帮助了我,但是在使用 Install-Module PowerShellGet -Force 命令安装 powershell 获取模块时,我们在 Windows 10 操作系统中遇到错误,说明以下错误模块“PackageManagement”不能安装或更新,因为文件“PackageManagement.cat”的验证码签名无效。所以我们必须运行像 Install-Module PowerShellGet -SkipPublisherCheck -Force 这样的命令来覆盖这个问题。然后一切顺利,然后我们可以继续创建 azure rm 模块。
    猜你喜欢
    • 2020-11-15
    • 1970-01-01
    • 2021-10-30
    • 2019-07-27
    • 2011-03-30
    • 2012-03-08
    • 2016-11-04
    • 2016-09-29
    • 1970-01-01
    相关资源
    最近更新 更多