Does publishing one function app wipe out the functions from the other function apps when they both reference the same storage account?

David Buckell 191 Reputation points
2022-04-19T17:59:00.087+00:00

I am in the process of migrating my .NET Core 3.1 function app (v2) to .NET 6 (v4).
Both shared the same storage account.
I have noticed on 2 separate occasions that having published the .NET 6 function app, the functions from the .NET Core function app are removed.
This article suggests that it is possible but does advise against doing so: https://learn.microsoft.com/en-us/azure/azure-functions/storage-considerations
194285-image.png

I notice within storage explorer that file shares & disks exists, relating to function apps & resource groups. This may point at a potential issue although my function apps are assigned to different resource groups.

If this is indeed the case should the portal not prevent multiple function apps from sharing storage accounts?
This is only something that I spotted whilst migrating & will not be adopting this strategy going forwards, but others might & it might be useful to gain some clarity here.

thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,610 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,897 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,446 Reputation points
    2022-04-21T10:57:51.097+00:00

    @David Buckell ,

    Thanks for posting this question in Q&A.

    Ideally publishing one function app that shares a storage account with another function app doesnt wipe out the contents of the other app. If two or more functions are sharing the same storage account and the functions are being published, different fileshares (one for each function app) gets created in the Storage account. Please see below screenshot of my storage account that is shared by multiple function apps

    195155-image.png

    When you publish a functions to the same function app, the contents gets overwritten. Another scenario where you will lose the existing function is that, if you have the same fileshare value specified in the app setting WEBSITE_CONTENTSHARE in both function apps, the contents will be overwritten.

    However, as you mentioned, sharing storage accounts between function apps is not recommended. Here is why this isnt recommended : https://github.com/MicrosoftDocs/azure-docs/issues/87366

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.