Functions published as a VS2015 Web Application not showing up in the portal list - azure

I followed the roadmap to create a set of Azure Functions as a Web Application. They deployed without an issue to my Azure Function App.
I moved the project to a new solution and changed the name spaces and updated the function.json files. When I redeployed to the Function App I was getting a bad entry point on one function which I double checked and tried to update a couple of ways without any success.
Thinking that the Function App might be caching I tried restarting the app and then finally went into the App Service Editor and deleted all the files and republished. Now none of the functions show up in the list even through the directories and function.json files for each function are confirmed present.
Has anyone else experienced something like this or have a suggestion as to how to resolve it?

It looks like your script file in function.json is set to a dll that doesn't exist in bin. Double check the dll name there.
You can see the content of bin folder on azure through debug console by going to https://<yourAppName>.scm.azurewebsites.net/DebugConsole

Related

Azure Function function.json file is missing

I published my Azure Function, it run as expected. Then I updated the code a bit without changing any configurational value. Now my function.json file is missing in Azure and my function is not running...
I published with new profile. I was expecting to see function.json file.
Glad #FurkanKaracan, that you have resolved the issue by restarting the IDE and redeploying it.
Function.json file missing issue will be caused if the function project is deployed with Runtime Issues.
That file is generated by the Function SDK in .csproj file Microsoft.NET.Sdk.Functions NuGet Package.
Any Changes to this file configuration code bindings are not allowed.
I have checked the following test cases to make the function.json file missing in the Code+Test menu:
Disabled the Function and redeployed from local IDE.
Published Several times by making function code changes through IDEs and CLI Commands.
Checked the Kudu Site of my Function App for every publish/deploy.
That file was visible perfectly how many times I redeploy the project to function app in the Azure Portal.
As per my experience, it might be some deployment issues while publishing.
Refer to this MS Doc for more info on function.json file.
Restarting visual studio and redeploying the app fixed the issue. I really hate microsoft's technologies...

Deploying [different-project-folder] instead of selected folder [current-project-folder]. Use "appService.deploySubpath" to change this behavior

I have two projects I'm working on for two separate Web Apps on Microsoft Azure under the same subscription. The first Web App project works fine, but for some reason when I try to deploy my new project to the other Web App, VSCode keeps telling me:
Deploying [first-project-folder] instead of selected folder [current-project-folder]. Use "appService.deploySubpath" to change this behavior.
Even when I change this setting to point to the correct project folder, it does the same thing. Nothing changes. I'm using the Azure App Service extension in VSCode on Windows 10.
I had a similar problem, and it was because I was changing the deploySubpath in the wrong settings.json file. I changed the one in the directory I was trying to deploy and it didn't work.
Try changing settings.json under the root \.vscode.

Cannot delete Azure Function dll from wwwroot/bin folder

I am using kudu console to redeploy my azure function actifacts, however when i try to delete old artifacts bin folder is failed to delete, i get 409 Conflict: Canot delete directory, it is either not empty or access is not allowed.
When i try to delete the function dll failed with 404 not found error as shown below. I cannot find any handle with function dll.
I have no APP Setting configured for WEBSITE_RUN_FROM_PACKAGE. Any idea why this behaviour and how to delete old artifacts and re-deploy new function artifacts?
Update
I have toggled WEBSITE_RUN_FROM_PACKAGEV 0 to 1 and switched back to 1 to 0. Now i able able to delete the bin folder, looks like there is a process still using my function application dll but can not be found in process explorer. When function runtime is restarted the resource is released very weird!
The reason for the WEBSITE_RUN_FROM_PACKAGE setting is that vs2019 is used for release, and vs2019 is released, which uses zip deploy.
Now if you want to modify or delete the file, the only way to do it is to set WEBSITE_RUN_FROM_PACKAGE = 0 and then modify it. In the current version of the function app, after modifying WEBSITE_RUN_FROM_PACKAGE = 0, all the contents in the wwwroot folder will be deleted.
(after testing, the function app created after April 1st and 2nd will have this phenomenon. Contact a Microsoft engineer to confirm This is normal expected behavior.)
If you want to modify the file, it is not recommended to use vs2019 to publish directly. It is recommended to use the command line to publish. Because of this you can read and write files under wwwroot.
func azure functionapp publish function_app_name --csharp --nozip --force
For more details, you can refer my answer in below post.
How to change content dynamically after function is called in Azure function app

New deployed azure function returns 404 Not Found error

Hey I have deployed new azure function using Azure dev ops CI/CD. The function app has been deployed successfully and when I go to the main URL, it says your function app is running. I tried to test the end points("/save") using azure portal and the output is 404 Not found. The same results when I use POST man as well. Any help would be appreciated?
2020-11-21T11:30:45.769 [Error] The following 2 functions are in error:
Get: The function type name 'DocumentContextFunction.Functions.GetDocument'
is invalid.
Save: The function type name
'DocumentContextFunction.Functions.SaveDocument' is invalid.
I have fixed this by updating the value of the "FUNCTIONS_EXTENSION_VERSION" from 1 to 3. For some reason every time I deployed using Azure CI/CD, its value is set to 1, so I have to manually change it to be 3.
I encountered this error when my build targeted win-x64 whereas the Azure Function Platform was configured as 32 bit.
In my case I had a function created in portal. I then published a function via visual studio. After publishing the portal created function was 404 not found and I could not even delete the function from the portal.
Exact same code in a new function worked as expected.
This is not intuitive and were no indications in the portal that previous portal created functions would break.
This maybe buried somewhere in documentation but I would have expected a warning in azure before allowing other functions to break without code changes.
The author's question helped me understand where the problem was coming from. In my case, it was not about the CI/CD pipeline doing anything funny.
It was my IaC code which was not setting up the function app properly. It picks version ~1 by default but I had to set it to ~3.
My function apps were working until I included a new custom package with a later version of Microsoft.Extensions.Logging. My functions were using Microsoft.Extensions.Logging 2.1.1. The package had version 7.0.0, which is for Net7. It was incompatible with my Net6 projects.
When the package was added, the Microsoft.Extensions.Logging version in my project was updated to 7.0.0. The were no compile errors, but debugging showed that the assembly could not be loaded. This was causing the 404.
Changing the package version back to 2.1.1 corrected the problem.
This is what worked for me...
Note: I was getting 404 on my function which is a nodejs and inline editing on the browser.
Open your function.json and take a backup as we are going to change it.
See if in your function.json there are two different settings with "direction": "in"
For me there were two. I tried deleting but it keep coming back.
Next I went to 'Integrations' (on left menu) and opened my trigger and deleted it. This will recycle your trigger. And hope this works for you too.

Publish Azure WebJob including all items from bin-folder

I'm trying to publish my WebJob which is connected to an Azure Website. So I use Publish on the website. This will publish the site and inside the App_Data-Folder the files for the WebJob are deployed.
The problem is, that I use the NuGet package Microsoft.SqlServer.Types inside the WebJob which brings 2 dlls one of which is a C++ native lib. This dll lays in "/bin/SqlServerTypes" of my WebJob-bin-folder which wouldn't be deployed by the publish-operation. Only items directly laying inside of the bin-Folder of the WebJob are deployed.
How can I ensure, that the complete bin-folder from the WebJob-project is deployed to App_Data on the web?
What I tried so far is:
Adding a project-reference to the WebJob-project in the WebSite-project.
Generating the folder-structure under App_Data in VS and referencing the dll there.
Edit: Turns out, that I had a simple spelling bug when creating the structure beneath the App_Data-Folder. In my case it worked when I just added those dlls in the folder the tooling expected them to be. See the answers for other good links.
I had a similar issue. Check this out.
As far as I know, this hasn't been solved yet. A workaround is to copy the relevant dependencies via FTP.
Hope this helps.

Resources