I have published an Azure Function through visual studio. Now I want to delete the published Azure function and the button to delete is disabled. Is there a way to delete the azure function published from VS?
After we publish code from VS, Azure portal will set functions to be Read Only to prevent us editing pre-compiled assets in portal.
If we use web deploy(didn't check Run from package file),
Here are two choices:
Delete all functions directly in portal. In portal, stop Function app then Platform features> App Service Editor, delete everything except host.json.
Note: I once provided a plausible solution--Platform features> Function app settings, change Function app edit mode to Read/Write, then we are able to click delete button. In this way we can delete specific functions but actually we didn't delete pre-compiled dlls which may accumulate and cause trouble.
Delete all old functions the next time we publish new ones. On publish panel, click Manage Profile Settings and check Remove additional files at destination.
If we have checked Run from package file when publishing, then none of those means could work. In addition to publish again, we can go to Platform features> Application settings, remove WEBSITE_RUN_FROM_PACKAGE under Application settings section and function app will become empty. Refer to announcement of Run from package for more info.
With this approach, file will also accumulate in silence but it won't cause error to new functions. To remove old files, Platform features> Advanced tools (Kudu)> Debug console(CMD) and navigate to d:\home\data\SitePackages to delete zips not in use.
The simplest way is to delete all functions is to do this:
Change WEBSITE_RUN_FROM_PACKAGE to 0 in the portal for the function application you want to deal with
This will allow you to create a scripted function in the portal for the given application
Create one function and this actions will delete all other functions that came from the package.
It seems this issue has been resolved in Azure.
Remove the unwanted functions from code
STOP your Azure function App in Azure portal
Enable "Remove additional files at destination" option in profile settings popup
Republish the solution again and all the removed functions will be deleted from Azure Portal.
Related
I deployed an Azure Function 2 months ago.
My VS Code was running perfectly according to my needs. Now I had to make some changes to my deployed function. but upon opening it is showing nothing.
Even from sidebar Azure extension it is not loading exiting azure functions. I tried everything, signin-signout, reinstalling, restarting, but nothing is working out for me. If I try to make a new function it asks me to create a new source although our company subscription is arleady listing in sidebar.
Can someone please help me in this regard?
Screenshot is attached.
We have a lot of function apps deployed since many months and in recent days, but they are showing in the Visual Studio Code Azure Extension under Function App Resources.
Few Steps to retrieve the existing resources in the VS Code Azure Extension are:
Uninstall and Install the Extensions like Azure Account, Azure Functions, Azure Resources, Azure Tools under Extensions blade:
Click on Settings (Gear Icon) > Make Sure your Microsoft Account is synced. If not, Sync it:
Check one of the workaround given for similar issue by #HAL9000
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?
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.
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.
This piece of documentation references configuring an azure function by way of a file on D:\home\data and a local json file.
https://azure.microsoft.com/en-us/documentation/articles/functions-triggers-bindings/#apikeys
First of all, where is the file/source code when the function is created through the portal dashboard UI, and how can I change those settings?
I'm assuming that this is the case when the service is created through the git method, but I don't see how to change the settings or view the keys through the dashboard.
We haven't built portal UI yet for managing these secrets/keys. We'll get to that soon.
So for now, they must be modified manually and that was the intent of that documentation, to show you the underlying details so you could do that if you needed to (until the portal UI is done).
I think the bit the doc left out that you might be missing is that to see the underlying files, you can use the Kudu. You can open up Kudu from the Functions portal by selecting "Function app settings", hitting the "Go to App Service Settings" button, hit the "Tools" toolbar button, and launching Kudu from the UI blade.
After you have opened up Kudu on your Function App, you can open the Debug Console on the root of your Function App, allowing you to navigate to the various files the doc mentions. For example data\functions\secrets or site\wwwroot which is where your function scripts are stored.
My problem is that I have a NuGet server on an Azure website using Azure AD for auth. It works as expected if I hit the NuGet URL in Chrome (requires the login, which accepts appropriate credentials), but if I try to access it in Visual Studio 2013 (through manage NuGet packages) it won't accept the account/password as appropriate credentials (the prompt just pops up again). My approach was as follows:
With the goal of creating a simple internal NuGet server, I largely followed the instructions in this article to deploy one on an Azure website: http://www.codeproject.com/Articles/872230/Create-Your-Own-Private-NuGet-Server-in-Windows-Az
The NuGet server works just fine, but I wanted to add some basic auth since we'll be hosting some of our code there. I decided to try to use Azure AD for this. I added a couple Microsoft accounts (mine and a coworker's) to our otherwise empty default Azure active directory. Through the management portal, I then selected the 'configure' tab in the website dashboard and added the default directory in the auth section.
Since the developers who will be pulling down our packages will do so through Visual Studio, I need to figure this out or find an alternative. I would like (if possible) to avoid writing my own auth module, since this feature is supposed to be baked into Azure.
It turns out that NuGet does not currently support Azure AD. However, they are working on it and progress can be tracked here: https://github.com/NuGet/Home/issues/708
I enabled the Web Deploy feature for my Web Role and deployed it.
But how can I get hold of the .publishsettings file so I can create a Publishing Profile for it?
This 2 year old article states that it should have been created automatically, but I haven't got that in my profile manager.
Any ideas?
If you are using Visual Studio 2012 or greater, the server explorer to the left will have several Azure items.
Specifically the Windows Azure Compute is what we are looking for, right click on that and say 'add deployment environment'. You will then be prompted with a dialog that allows you to sign in and download publish settings file:
You can get publishsettings file from the following link: https://windows.azure.com/download/publishprofile.aspx
Well, the problem was really behind the keyboard.
So the publishing profile is actually provisioned correctly and automatically to the Web project as the documentation states.
The problem and confusion was that I have a secondary web application in my Solution that I also publish to the same Web Role (referenced as an additional Site in the ServiceDefinition.csdef file).
That Web Project does not get the Publishing Profile, and when I try to create a profile manually, it doesn't work since that (secondary) IIs instance is not configured for Web Deployment.
Oh well, back to the tedious Cloud Service deployment it is...