2
votes

New to Azure functions, but looking to utilize a Function in an ADF pipeline to call out to a third party and write the json back for ingestion.

However, I receive Result: Failure Exception: OSError: [Errno 30] Read-only file system: ... "/home/site/wwwroot/AzureFunctionFileTest/init.py", line 10, in main with open('test.json', 'w') as file.

My script is below:

logging.info('Python HTTP trigger function processed a request.')

logging.info('opening file')

with open('test.json', 'rb') as file:
    logging.info('creating data')
    data = "Hello world"
    logging.info('writing file')
    file.write(data)

return func.HttpResponse(f"This HTTP triggered function executed successfully with {data}.")

Is there an Azure Function config that I'm missing?

1

1 Answers

2
votes

The current directory is indeed read-only. Use /tmp for temporary files (for example, open('/tmp/test.json', ...). For more details, see https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python#temporary-files.