Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing functions to function app from Visual Studio does not remove deleted functions #2009

Closed
codebrane opened this issue Aug 9, 2021 · 3 comments

Comments

@codebrane
Copy link

After creating a function app in the Azure portal and deploying a locally developed function app in Visual Studio with one function it works as expected.

e.g. TestFunctionApp has one function called TestFunction

After Renaming TestFunction to NewFunction in VisualStudio and re-publishing to the function app in Azure, the function app has two functions:

TestFunction and NewFunction.

There are no references to TestFunction in the Visual Studio project after renaming.

Is there a way to remove non-existent functions from a function app?

@v-bbalaiagar v-bbalaiagar self-assigned this Aug 9, 2021
@v-bbalaiagar
Copy link

Hi @codebrane, You can disable functions in the function app as mentioned in the document- https://docs.microsoft.com/en-us/azure/azure-functions/disable-function?tabs=portal#disable-a-function
Please check and let us know if this helps.

@codebrane
Copy link
Author

thanks for that. I've been disabling them to show they are not relevant but they don't exist so I shouldn't have to disable them. They also propagate through Azure. If I import from the function app to APIM the non existent functions are displayed as options to be imported. Is there a way to remove them entirely from the function app? Removing them from the function app in Visual Studio doesn't remove them from the function app in Azure.

@codebrane
Copy link
Author

It turns out it's a VisualStudio thing. I found this issue which describes how to delete non-existent functions on publish. For VisualStudio Mac this worked for me:

Properties/PublishProfiles/TestFunctionApp - Web Deploy.pubxml

and adding:

<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>

It only works if I choose that publish profile from the list otherwise using Publish to Azure overwrite the publish profile and sets SkipExtraFilesOnServer back to True and non-existent functions aren't deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants