3

I'm trying to execute an azure automation powershell runbook using the webhook. But, not sure how to pass the parameters to the powershell script.

PoSh to call webhook

$webhook = "https://ajsiyeqw12-732y-243z-9zashysdg.webhook.us.azure-automation.net/webhooks?token=asjfhhye232874829mxsdxbsahfts"
Invoke-WebRequest -Method Post -Uri $webhook

underlying PoSh that has parameters

Param(
 [string]$resourceGroup,
 [string]$VMName,
 [string]$method,
 [string]$UAMI 
)

How would we pass the input parameters resourceGroup, VMName etc., to the webhook url to execute the underlying powershell. I am looking to use management api instead for executing the runbook.

https://learn.microsoft.com/en-us/rest/api/automation/job/create?tabs=HTTP

pbj
  • 663
  • 1
  • 8
  • 19

0 Answers0