Hi @Raj D ,
let's start with a simple Automation Runbook with a simple PowerShell script.
Create a new Automation Runbook and add the following PowerShell script:
param
(
[Parameter(Mandatory = $false)]
[object] $WebhookData
)
$Inputs = ConvertFrom-Json $webhookdata.RequestBody
Write-Output "Name of VM = $($Inputs.vmName)"
Write-Output "Name of ResourceGroup = $($Inputs.rgName)"
Create a webhook for the Runbook and save the URL
Run the following PowerShell script on your computer to start the Azure Automation Runbook with input parameters :
$webhookURI = '<your-webhook-URI>'
$params = @{
vmName ="TestVM1";
rgName ="test1-rg"
}
$body = ConvertTo-Json -InputObject $params
$response = Invoke-WebRequest -Method Post -Uri $webhookURI -Body $body -UseBasicParsing
$response
The output of the Runbook should look like this:
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten