AzUser1
AzUser1

Reputation: 193

Calling a HTTP Trigger Logic App (Post Call) with an Azure Function (Python)

I have a Azure Logic App with a http trigger and would like to call this logic app with a Azure Function. I have tried to make a post call using the Requests Library. The code looks sth like this:

import requests

url='https://prod-56.westeurope.logic.azure.com:...'
requests.post(url)

When I try this code with VS Code it works. But somehow it doesn't work in Azure Functions. I have already changed CORS in the Azure function to allow all but it still didn't work. Any idea how i can call the logic app with a azure function in python?

Upvotes: 0

Views: 1699

Answers (1)

RithwikBojja
RithwikBojja

Reputation: 11218

I have reproduced in my environment and got expected results and i followed below process:

Firstly , I created http trigger in my local vs code as below and i added the code which i need to call logic app as below:

url='XX'
requests.post(url)

XX- url of logic app enter image description here

My requirements.txt:

enter image description here

Then i deployed my function to azure and in portal requirements looks like below:

enter image description here

In code test of function:

enter image description here

enter image description here

Then in logic app( My logic app got triggered):

enter image description here

Upvotes: 1

Related Questions