如何在 Python Runbook 中获取 Azure 自动化 Runbook 作业 ID?

问题描述 投票:0回答:1

Powershell Runbook 允许您使用 $PSPrivateMetadata.JobId.Guid 获取作业 ID

如果 Runbook 是 Python,我们如何获取它?

python python-3.x azure azure-automation azure-runbook
1个回答
0
投票

根据 API 文档,您可以使用

r = azure.mgmt.automation.models.Runbook(<options>)
创建 Python Runbook,然后访问
r.id
属性。

来源:https://learn.microsoft.com/en-us/python/api/azure-mgmt-automation/azure.mgmt.automation.models.runbook?view=azure-python

© www.soinside.com 2019 - 2024. All rights reserved.