How to call an Azure API after completing a Runbook that calls a Stored Procedure

89 Views Asked by At
  • I've got an Runbook within an Azure Automation Account that calls a Stored Procedure within an Azure SQL Database. Is there a way to call an Azure API (.azurewebsites.net/api) once the stored procedure has completed?

I found a similar question and the answer was the following:

$Url = "https://my-url"
$Body = @{
    field = "value"
}
Invoke-RestMethod -Method POST -Uri $url -Body $body -UseBasicParsing

However, I'm not sure if this is added to the same Runbook or if I need to create a logic app to run afterewards.

1

There are 1 best solutions below

0
RithwikBojja On

I have reproduced in my environment and below are my expected results:

1st Approach:

Create 2 runbooks and then and edit them with the code and then use below design:

enter image description here

Here starting two jobs, each action calls each job.

The above process is similar to starting two runbooks and gets the output:

enter image description here

2nd Approach:

Creating 1 runbook and then calling it using HTTP connector in Logic apps as below:

enter image description here

In body you can also send the output of above create job action as below:

enter image description here

Output:

enter image description here