Note: Only support Linux Function App, Windows Container Function App
Doc:
- https://learn.microsoft.com/en-us/azure/azure-functions/scripts/functions-cli-mount-files-storage-linux
- https://learn.microsoft.com/en-us/azure/azure-functions/storage-considerations?tabs=azure-cli#mount-file-shares-
When deploy the Azure Functions can access the fileshare via filesystem
and you can see all files in the file share
Note: This code cannot run on local, please test on Azure.
- copy
.env.sample
to.env
- then run local
yarn dev
- Prep Azure Functions Config on local, create
local.settings.json
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
},
"ConnectionStrings": {}
}
- Run with Azure Functions worker
yarn start
-
Create Azure Functions on Azure via CLI
export randomIdentifier=$RANDOM$RANDOM ./scripts/create-infra.sh $randomIdentifier
-
Deploy
./scripts/deploy.sh $randomIdentifier
az group delete --name msdocs-azure-functions-rg-$randomIdentifier