I’m new in Azure so I have some gaps in my knowledge. I’ve been looking for answer but couldn’t find one.
Within my app function which is HTTP TRIGGERED I do make some api call to retrieve json. If everything goes fine, then the function returns this json.
return func.HttpResponse( json.dumps(apiReturn), status_code=200 )
I’d like then to use this json (return) to store it in nsql db or csv for further processing. Is this possible somehow or I just need to create separate json file on function stage and upload it to blob storage?
Yes! you can store it into blob storage using Blob bindings found here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-input?tabs=python
You can also take a look at this to find more examples: https://github.com/yokawasa/azure-functions-python-samples/tree/master/v2functions/queue-trigger-blob-in-out-binding
Long story short, what you have to do is:
- Change your function.json to take in blobs
- Change your code to take in an input blob
- Add your blob keys to both your local.settings.json as well as on your function app in the portal configuration.
and that should get you where you need to go!