Function app fails to create file share with vnet integration enabled.

Hariprasad 5 Reputation points
2023-03-24T11:37:21.45+00:00

I am creating the function app with premium plan and with the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE app settings. This fails to create the file share in the storage account and shows function host time unreachable.

It will work if I create fileshare while creating storage account but I want that to be automatically created

I have also added the WEBSITE_CONTENTOVERVNET settings

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,856 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Urnun 9,801 Reputation points Microsoft Employee
    2023-03-28T23:23:19.31+00:00

    Hello @Hariprasad - Thanks for reaching out & posting on the MS Q&A channel!

    I suspect the issue is to do with setting the WEBSITE_CONTENTSHARE. With an automatic approach via ARM, the recommended approach is to not set the WEBSITE_CONTENTSHARE app setting as it'll be auto-generated during ARM deployment. The following considerations are noted for ARM deployments:User's image

    On the other hand, as stated above, if your storage account is in a VNET, you should then specify a value for the WEBSITE_CONTENTSHARE setting.

    Depending on your exact scenario, here are some working samples (maintained by MS) that you can use to enhance the one that you're working on: https://github.com/Azure-Samples/function-app-arm-templates#arm-templates-for-function-app-deployment

    For the scenario where the Storage Account is secured by the VNET, it looks like the file share resource is created explicitly:

    {
          "type": "Microsoft.Storage/storageAccounts/fileServices/shares",
          "apiVersion": "2022-05-01",
          "name": "[format('{0}/default/{1}', parameters('functionStorageAccountName'), variables('functionContentShareName'))]",
          "dependsOn": [
            "[resourceId('Microsoft.Storage/storageAccounts', parameters('functionStorageAccountName'))]"
          ]
    }
    

    I hope this helps, and I look forward to your reply ;)

    0 comments No comments

Your answer

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