I'm creating this azure function in python, getting data from HTTP post and save to azure blob storage.
def main(req: func.HttpRequest, outputblob: func.Out[bytes]) -> func.HttpResponse:
# clientId = req.params.get("clientId")
clientId = os.environ["OS"]
# clientId = "abcdef"
req_body = req.get_json()
outputblob.set(json.dumps(req_body))
here is blob out binding part of function.json
{
"name": "outputblob",
"type": "blob",
"dataType": "binary",
"path": "container/{clientId}/{datetime:yyyy}/{datetime:MM}/{datetime:dd}/{rand-guid}.json",
"connection": "DatalakeConnectionStr",
"direction": "out"
}
I tried 3 different option for parameter of clientId
- clientId = req.params.get("clientId") <- from URL parameter, this one works
- clientId = os.environ["clientId"] <- from configuration, this one not working
- clientId = "abcdef" <- this one not working
I really like to make os.environ["clientId"] one works. how to make it works.
Thanks, Wes