I would like to Save my logs file, Json file and Txt file generated from Function App python script to Azure storage. My current code looks like this
import logging
logging.basicConfig(
format=’%(asctime)s %(levelname)-8s %(message)s’,
level=logging.INFO,
filename = ‘Log.txt’,
datefmt=’%Y-%m-%d %H:%M:%S’)`
def main(mytimer: func.TimerRequest,outputblob: func.Out[bytes]) -> None:
# codes with logging
function.json file:
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "mytimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 0 20 * * *"
},
{
"name": "outputblob",
"type": "blob",
"dataType": "binary",
"path": "test/log.txt",#is this the path to my storage account?
"connection": "MyStorageConnectionAppSetting",#is this just a naming or it is reference to anything?
"direction": "out"
}
]
}
`
Would Like to save my logs file, Json file and Txt file generated from Azure function to Azure storage
ra po is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.