导入已保存的AzureRMContext仍需要密码(Import saved AzureRMContext still requires password)

编程入门 行业动态 更新时间:2024-10-24 13:27:40
导入已保存的AzureRMContext仍需要密码(Import saved AzureRMContext still requires password)

我使用Save-AzureRmProfile为我的所有脚本并行执行azure请求。 我从powershell /自动登录到azure借用了这个想法

我不得不将我的系统更新到最新版本(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.

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

I was using Save-AzureRmProfile for all my scripts to execute azure requests in parallel. I borrowed this idea from auto login to azure with powershell/

I had to update my systems to latest version (AzureRM > 4) and despite the fact that the AzureRmProfile are now AzureRmContext cmdlets I still cannot use it as before.

Scenario

Open a PS console and execute

Save-AzureRmContext -Profile (Add-AzureRmAccount) -Path myprofile.json # List my VMs Get-AzureRmVm

Open a second PS console

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.

How can I reuse my profile to be loaded in parallel executions?

最满意答案

cmdlet中存在一个错误。 你做的不多(只有降级)。

在此处跟踪: https : //github.com/Azure/azure-powershell/issues/3954

There's a bug in the cmdlets. Not much you can do (only downgrade).

Track it here: https://github.com/Azure/azure-powershell/issues/3954

更多推荐

azure,执行,PS,credentials,电脑培训,计算机培训,IT培训"/> <meta name="descr

本文发布于:2023-07-25 22:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1267184.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密码   Import   AzureRMContext   password   requires

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!