Azure Logic Apps Standard | Keep WEBSITE_CONTENTSHARE Unique
Overview
WEBSITE_CONTENTSHARE is an app setting used by Azure Functions and Logic Apps Standard (which runs on the Functions runtime) alongside WEBSITE_CONTENTAZUREFILECONNECTIONSTRING to identify the Azure Files share the app uses for its content.
The important thing to call out up front: you don’t always need to set this. When left unmanaged, Azure generates a share name for you automatically and everything just works.
There are, however, scenarios where you must set it to a predefined value. The most common is when you use a secured storage account in a virtual network - in that case, you must set a unique share name for the main app and for the app associated with each deployment slot. For a storage account secured by a virtual network, you must also create the share itself as part of your automated deployment (see Secured deployments).
The reason it’s worth understanding at all is that getting it wrong doesn’t fail loudly.
How the File Share Backs Your Logic App
Rather than storing your workflow definitions and related files directly on the Logic App instance, the runtime uses an Azure Files share (identified by WEBSITE_CONTENTSHARE, within the storage account referenced by WEBSITE_CONTENTAZUREFILECONNECTIONSTRING) and treats it as the source of truth for the app’s content such as your workflow .json definitions, host.json, and inline code .csx.
In other words, the file share isn’t just a supporting piece of infrastructure - it is the app, from a content perspective. Whatever is in that share is what the app runs.
The Incident
I came across a case where two separate Logic App Standard resources had been deployed referencing the same storage account, and whether through copy-pasted deployment parameters or a naming convention that didn’t account for it, had both ended up with the same WEBSITE_CONTENTSHARE value.
The symptoms were bizarre (mainly due to always having had isolation of storage accounts and certainly file shares). Workflows authored in one Logic App started showing up in the other. A deployment or a change made through one app’s designer would be reflected in the second app, and vice versa. Two Logic Apps, with different names, different resource IDs, sitting in different places in the resource group, yet behaving as if they were the same application. Nothing about the apps themselves looked wrong, which made it a genuinely uncomfortable thing to debug. The only thing that was the same was the workflow name.
Root Cause
Once traced back, the explanation was straightforward, both Logic Apps were pointed at the exact same Azure Files share. Since the content share is the app’s set of workflows and artifacts, both Logic App resources were reading from and writing to the identical set of files.
There weren’t two apps with similar configuration that happened to drift into sync, there was only ever one set of workflow content, fronted by two separate compute resources. Both apps were simply reading and writing the same underlying files the whole time.
Recommendation
If you never explicitly manage WEBSITE_CONTENTSHARE, Azure will generate a unique value for you and you won’t hit this. Where you do need to set it, such as with a VNet-secured storage account, or when cloning an app or restoring from a backup, make sure the value is unique per app instance, including for the main app and each deployment slot.
⚠️ Note
After deploying, it’s worth a quick sanity check against the Files service in the storage account to confirm each app has its own distinct share, particularly if your deployment pipeline sets this value explicitly or reuses parameter files across environments.
Conclusion
It’s a strange situation to land in, two apps that are, for all practical purposes, one app hosted twice, but it’s also entirely avoidable. WEBSITE_CONTENTSHARE is one of those settings you can safely ignore most of the time, but if you do find yourself setting it explicitly, uniqueness per app is non-negotiable.
For the original version of this post see Andrew Wilson's personal blog at Azure Logic Apps Standard | Keep WEBSITE_CONTENTSHARE Unique