混合工作者Runbook中的Set-AzureRmContext不起作用 [英] Set-AzureRmContext in Hybrid Worker Runbook not working

查看:43
本文介绍了混合工作者Runbook中的Set-AzureRmContext不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 -


在我的Runbook中,我使用的是"AzureRunAsConnection"。帐户以访问我的订阅"A"中的Azure资源。我也可以使用对订阅"B"的更改。使用Set-AzureRmContext命令并访问Subscription
" B"中的Azure资源。当我将Run选项用作"Azure"时,此Runbook运行正常。


我想使用Hybrid Worker来运行此Runbook。我在Subscription"A"中设置了一个Azure VM。作为混合工人运行。当我使用此worker运行此Runbook时,Set-AzureRnContext无法将上下文更改为Subscription"B"。
任何想法,缺少什么。


谢谢 

解决方案

Hello Mohit,






Set-AzureRmContext失败后是否抛出任何错误?我建议仔细检查perms是否正确设置。与Azure自动化沙箱不同,混合Runbook工作者没有Azure的默认上下文。

https://docs.microsoft.com/en-us/azure/automation/automation-hrw-run -runbooks#运行手册的权限

Hi -

In my runbook, I am using "AzureRunAsConnection" account to access Azure Resources in my Subscription "A". I am also able to use change to Subscription "B" using Set-AzureRmContext command and access Azure Resources in Subscription "B". This runbook runs fine when I use Run option as "Azure".

I want to run this runbook using Hybrid Worker instead. I have setup an Azure VM in Subscription "A" to run as Hybrid Worker. When I run this runbook using this worker, the Set-AzureRnContext fails to change the context to Subscription "B". Any idea, what is missing.

Thanks 

解决方案

Hello Mohit,

Are there any errors thrown after Set-AzureRmContext fails? I recommend doublechecking that the perms are setup correctly. Unlike Azure Automation Sandboxes, Hybrid runbook workers don’t have a default context of Azure. https://docs.microsoft.com/en-us/azure/automation/automation-hrw-run-runbooks#runbook-permissions


这篇关于混合工作者Runbook中的Set-AzureRmContext不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆