gpt4 book ai didi

Azure 自动化 : Runbook: does it know it's TenantID?

转载 作者:行者123 更新时间:2023-12-03 05:37:29 27 4
gpt4 key购买 nike

下午好

我猜想这个关系是正确的:

Azure Tenant
» Azure Subscription
» Azure Automation
» Runbook

因此我有这个问题:

是否有 PowerShell 命令可用于获取运行 Runbook 的 TenantID?

最佳答案

如果您想在 Runbook 中运行命令,可以使用以下命令:

$servicePrincipalConnection = Get-AutomationConnection -Name "AzureRunAsConnection"        
Write-Output $servicePrincipalConnection.TenantId

enter image description here

注意:有一个前提条件,当您创建自动化帐户时,需要选择Create Azure Run As accountYes,否则是AzureRunAsConnection 不存在。

enter image description here

关于Azure 自动化 : Runbook: does it know it's TenantID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61363861/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com