powershell - 导入保存的 AzureRMContext 仍需要密码

标签 powershell azure

我对所有脚本使用 Save-AzureRmProfile 来并行执行 azure 请求。我从auto login to azure with powershell/借用了这个想法

我必须将系统更新到最新版本 (AzureRM > 4),尽管 AzureRmProfile 现在是 AzureRmContext cmdlet,但我仍然无法像以前一样使用它。

场景

打开 PS 控制台并执行

Save-AzureRmContext -Profile (Add-AzureRmAccount) -Path myprofile.json

# List my VMs
Get-AzureRmVm

打开第二个 PS 控制台

Import-AzureRmContext -Path myprofile.json

# List my VMs
Get-AzureRmVm
Get-AzureRmVM : Your Azure credentials have not been set up or have expired, please run Login-AzureRMAccount to set up your Azure credentials.

如何重用我的配置文件以在并行执行中加载?

最佳答案

cmdlet 中存在错误。您无能为力(只能降级)。

在这里追踪:https://github.com/Azure/azure-powershell/issues/3954

关于powershell - 导入保存的 AzureRMContext 仍需要密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44519462/

相关文章:

c# - 将 powershell 对象另存为 xml 并在 c# 中加载

azure - Mac 中的 Powershell 问题

azure - 在服务之间共享 Azure Service Fabric 可靠队列

azure - Azure 上的 SignalR 聊天

xml - PowerShell XML 输出

powershell - Azure 如何使用任何 CLI/API 接收可用性集中虚拟机的分配容错域 ID?

powershell - 如何下载用于灾难恢复的完整 Azure IAAS 环境设置

sql - 使用逻辑应用查询结果中的结果

azure - 逻辑应用的 IP 白名单

c# - Azure 应用服务单点登录