如何在C#中使用Microsoft.Azure.Management.Automation Automation客户端启动Azure runbook/webhook?
我正在使用.NETSDK构建一个将触发Azure自动化运行手册的应用程序。我尝试使用webhook启动runbook,但找不到启动webhook并返回作业ID的方法 我正在使用命名空间中的AutomationClient: Microsoft.Azure.Management.Automation版本:3.8.0-preview如何在C#中使用Microsoft.Azure.Management.Automation Automation客户端启动Azure runbook/webhook?,c#,azure,azure-automation,azure-runbook,C#,Azure,Azure Automation,Azure Runbook,我正在使用.NETSDK构建一个将触发Azure自动化运行手册的应用程序。我尝试使用webhook启动runbook,但找不到启动webhook并返回作业ID的方法 我正在使用命名空间中的AutomationClient: Microsoft.Azure.Management.Automation版本:3.8.0-preview 我建议您可以改用AutomationManagementClient。以下是一个例子: AutomationManagementClient client =
我建议您可以改用AutomationManagementClient。以下是一个例子:
AutomationManagementClient client =
new AutomationManagementClient(new CertificateCloudCredentials(subscriptionId, cert));
// Create job create parameters
JobCreateParameters jcParam = new JobCreateParameters
{
Properties = new JobCreateProperties
{
Runbook = new RunbookAssociationProperty
{
Name = runbookName
},
Parameters = null // optional parameters here
}
};
// create runbook job. This gives back the Job
Job job = automationManagementClient.Jobs.Create(automationAccountName, jcParam).Job;
// then you can get the job id from the return Job object
有关更多详细信息,请参阅。我没有尝试过,但从文档中看到返回了一个具有模型的任务,您可以发现
作业ID
具有一个属性tanks,@Jayendran,但我认为GetWithHttpMessageAsync
用于检索已启动的作业。我正在寻找一个方法,将启动一个webhook或runbook,然后返回它的作业ID。该文档是缺乏的,但你可以尝试使用其他方法启动作业,并获得作业ID。