Skip to content

thaitype/nammatham-v2-azure-functions-file-share-example

Repository files navigation

Azure Functions with File Share Example

Note: Only support Linux Function App, Windows Container Function App

Doc:

When deploy the Azure Functions can access the fileshare via filesystem

and you can see all files in the file share

Local Dev

Note: This code cannot run on local, please test on Azure.

  1. copy .env.sample to .env
  2. then run local
yarn dev

Run Azure Functions Worker on Local

  1. Prep Azure Functions Config on local, create local.settings.json
{
  "IsEncrypted": false,
  "Values": {
      "FUNCTIONS_WORKER_RUNTIME": "node",
      "AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
      "AzureWebJobsStorage": "UseDevelopmentStorage=true"
      },
  "ConnectionStrings": {}
  }
  1. Run with Azure Functions worker
yarn start

Deploy to Azure functions

  1. Create Azure Functions on Azure via CLI

    export randomIdentifier=$RANDOM$RANDOM
    ./scripts/create-infra.sh $randomIdentifier
  2. Deploy

    ./scripts/deploy.sh $randomIdentifier

Destory

az group delete --name msdocs-azure-functions-rg-$randomIdentifier