Serve static files from all blob containers within a given storage account to clients over HTTP, respecting blobs' content types. Useful if you need to serve static files with App Service authentication.
A request for the URL /container/path
will yield the path
object in the blob container container
. If path
were a nested container with an index.html
object within we'd redirect to /container/path/
and serve index.html
. Note that all objects in all containers in the configured storage account will be accessible with no authorisation checks -- be sure that the data you're serving is intended to be public.
~3
.func azure functionapp publish <FunctionAppName>
from /AzureFunctionStaticFiles
to build the app and publish it.AccountConnectionString
must contain a connection string for your storage account.IndexName
sets the name of the default index page (Apache's DirectoryIndex
, nginx's index
).HostName
sets the name that should be used in redirects (optional; recommended if you're bringing your own domain or using a CDN).*.pfx
) format. To ensure redirect paths are correct, alter HostName
.Grab a copy of Visual Studio 2019 and install the following workloads:
Now continue on to the steps below.
You'll need a local Node.js and Yarn installation to run the Azure Functions SDK. From the root of the repository, install the Azure Functions SDK:
yarn install
It's easiest to work with a local storage account running under the Azure Storage Emulator. Start the emulator by launching "Microsoft Azure Storage Emulator - v5.10" from the Start Menu. You can stop the emulator from the taskbar icon or by running the following in the resulting Command Prompt window:
.AzureStorageEmulator.exe stop
You can then use the Azure SDK:
cd AzureFunctionStaticFiles/
yarn run func start
Open the Visual Studio Test Explorer and click Run.
dotnet test