cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lrarbin1977
Level: Powered On

HTTP Webhook, Azure Function (PowerShell) and MS Flow

Hello All,

I'm not sure if I should be posting this to teh MS Flow Group or Azure Functions! Anyway I'm trying to use the HTTP Webhook Action instead of the HTTP Action to try and resolve problems with Timeouts.
The HTTP Webhook calls an Azure Function written PowerShell. Calling the function works fine (it also works with the HTTP Action). The problem is I can't work out how to return to the Flow using the CallbackURL. I'm not sure if I should be using Invoke-RestMethod or Invoke-WebRequest or using the integration features in Azure Functions.
This seems to work, but I don't think I have the 'body' correct.

$Body = @{
firstName = 'John'
lastName = 'Doe'
email = 'john.doe@contoso.com'
birthday = '1980-10-15'
hobbies = 'Hiking','Fishing','Jogging'
}

Write-Output ($Body | ConvertTo-Json)

$Result = Invoke-RestMethod -Uri $requestBody.callbackURL -Method Post -body ($Body | ConvertTo-Json)
Thanks
Laurence
1 REPLY 1
Community Support Team
Community Support Team

Re: HTTP Webhook, Azure Function (PowerShell) and MS Flow

Hi @lrarbin1977 ,

 

Could you share the configuration of Flow and the details of run history?

Please consider modifying the content in the Body according to the execution result of the Flow, or refer to the data in the http response.

In addition, Here is a blog on Run any PnP-PowerAhell in one AzureFunction from Microsoft Flow for your reference:

http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 276 members 3,939 guests
Recent signins:
Please welcome our newest community members: