Can't access mounted file share on Azure function python v2

Claire 60 Reputation points
2023-04-19T08:53:36.0366667+00:00

Hi, I try to mount an Azure file storage to use with an Azure function in python v2. I followed those instructions :

[
  {
    "name": "datafiles",
    "slotSetting": false,
    "value": {
      "accessKey": "...",
      "accountName": "analyses",
      "mountPath": "/mnt/datafiles",
      "shareName": "datafiles",
      "state": "Ok",
      "type": "AzureFiles"
    }
  }
]

But the /mnt directory is still empty when I try to reach it from the function app. I went to Azure portal and don't have a "Path Mapping" tab in the Configuration part of the Azure function (only "Application settings" and "Function runtime settings". My function is quite simple :

import azure.functions as func
import logging
import os

app = func.FunctionApp() 

@app.function_name(name="listfile")
@app.route(route="test", auth_level=func.AuthLevel.ANONYMOUS)
def listfile(req: func.HttpRequest) -> func.HttpResponse:
    path = req.params.get('path')
    g = ""
    try:
        g = os.listdir(path)
    except Exception as e:
        logging.info(e)
    logging.info(g)
    return func.HttpResponse(
        json.dumps(g),
        status_code=200
    )

Any ideas ?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,186 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,394 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,236 Reputation points
    2023-05-05T17:28:20.96+00:00

    Based on the investigation, our product team found the cause and made fix [LinuxConsumption]Fix BYOS for Linux Consumption host. The issue details are described in the link, and we are looking to rollout this fix by the end of next week (subject to change based on other factors). We are sincerely sorry for any inconvenience caused by the issue.

    I hope this helps and let us know if you have any questions.

    Update 5/15:
    Currently, the roll out is in progress and ETA 05/19 for it to complete.

    Update 5/31:
    The roll out has been completed and if you still see the issue, please restart the app and try again.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful