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

标签 azure azure-automation azure-runbook

下午好

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

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/

相关文章:

c# - 使用调用堆栈进行 Azure Application Insights 调试

azure - 如何使用 Terraform 和 Azure 强制删除/释放网络服务组?

azure - 如何将Azure DevOps文件复制到其他物理网络文件夹

Azure 更新管理生成 csv 格式的补丁状态报告

Azure 自动化综合体时间表

azure - Powershell Runbook [Invoke-ASCmd],xmla 文件的 FileNotFoundException

azure - 启动-AzVM : Cannot bind parameter 'DefaultProfile' when running an Azure runbook

java - 对于条目太多的目录,ABFS hadoop-azure AzureBlobFileSystem.listStatus(path) 花费太多时间(不返回)

powershell - Azure 自动化 Powershell Runbook 无法进行 LoadAssembly

azure - 如何使用 Azure 更新管理自动对订阅下的所有虚拟机(包括 future 的计算机)进行补丁管理