Haris B.T
Haris B.T

Reputation: 125

Old Azure functions return after deleting and recreating publishing profile VS 2017

I have noticed that if Azure function e.g 'My-Function-App' is deleted using Azure portal and a new app with same name 'My-Function-App' is created in same resource group using Visual Studio 2017, then all old functions return to that new function app in read-only mode. Any idea what is happening here?

Upvotes: 2

Views: 1465

Answers (2)

Jerry Liu
Jerry Liu

Reputation: 17790

What @David has said is right, and I want to provide some details for you to refer.

all old functions return to that new function app

For Azure functions created in Consumption plan, one function app has one individual file share folder in the storage account you specified. You can see the file share name in your application settings tab in portal.

  • For functions created in portal, the file share name corresponds to the function app name plus an unique suffix generated by azure, like myfunctionae23.
  • For functions created using VS, the file share name is exactly the same as the function app name, like myfunction.

So if we publish a function app from VS, and its name happens to be identical to some existing file share which was used to store functions, these functions will be restored in the new function app.

in read-only mode

It is set by Azure due to publishing functions from VS. It's not recommended to make changes to files developed locally.

If you want to solve this with minimum changes, in publish panel, click Manage profile settings and click Remove addition files at destination and publish again. enter image description here

Upvotes: 7

David Ebbo
David Ebbo

Reputation: 43203

When a Function App is created, a Storage Account also gets created alongside in the same resource group. If you delete both (or delete the whole RG), you will see no traces of previous apps.

Upvotes: 3

Related Questions