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.

SRICHAKRI SRIMANTHULA 1 Reputation point
2021-06-30T15:47:05.403+00:00

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
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pierre-Luc Giguere 1,076 Reputation points
    2021-06-30T21:12:01.817+00:00

    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://learn.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package (troubleshoot part)

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.