question

SRICHAKRISRIMANTHULA-5479 avatar image
0 Votes"
SRICHAKRISRIMANTHULA-5479 asked PramodValavala-MSFT edited

How to read a file from Azure Blob Container using Python in function app and how do I read in data from my Azure Storage account when I launch my Function app.

we are having a JSON file in the blob and I have to access it and then convert it into CSV and then upload those CSV files to blob again .so for this criterion I have a code and it's working in visual studio but it's110649-500-internal-error.jpeg not working in the Azure portal.


110712-snippet.jpeg


110640-error-2.jpeg110705-error-in-app-insight.jpeg


azure-functions
snippet.jpeg (70.7 KiB)
error-2.jpeg (194.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PierreLucGiguere-5297 avatar image
1 Vote"
PierreLucGiguere-5297 answered PramodValavala-MSFT commented

Hello.

Is it possible that you are running the function from a deployment package file and also trying to have a temp file created in the current working directory of that package?

In Azure, you can run your functions directly from a deployment package file in your function app. The other option is to deploy your files in the d:\home\site\wwwroot directory of your function app.

Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory.

You can turn that off by deleting the WEBSITE_RUN_FROM_ZIP or WEBSITE_RUN_FROM_PACKAGE application setting in the portal.

Sources:
https://stackoverflow.com/questions/53630773/how-to-disable-read-only-mode-in-azure-function-app (part #1)
https://docs.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package (troubleshoot part)

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SRICHAKRISRIMANTHULA-5479 I believe anonymous user is spot on. The error that you are seeing is because of the file being opened when running from a package (which is the default for most deployment options).

But even when doing so, you could always use temporary files as shown in the python language reference.


1 Vote 1 ·