Skip to main content

Return JSON from Azure Functions with Python

Author by Nathan Lasnoski

I was working on an Azure Function for an open source wildlife IoT project and came across a lack of documentation in I had successfully returned HTTP content from my Azure function, but wasn’t sure how to get it to return JSON so I could interpret it elsewhere. In this case I’m storing latitute (lat) and longitude (lon) and returning them in JSON content:


Here’s the block:

 #at the top      
 import json

 #to return
         return func.HttpResponse (
            'lat': lat,
            'lon': lon





Nathan Lasnoski

Chief Technology Officer