Ignore folder or file for Node Azure Function App - node.js

I want my Node.js Azure Function App to ignore a test data file.
When I run my app, after adding the file, I see it trying to parse the file and showing the following error:
Worker was unable to load function ...
How do I tell the runtime to ignore this data file or the folder containing it?

As far as I Know,
Worker was unable to load function ...
This error comes when any packages installed outside of root node_modules folder and if those are not included in the runtime or deployment.
How do I tell the runtime to ignore this data file or the folder containing it?
.gitignore file plays major role in Azure Functions that used to ignore the specified files even they have changes.

Related

How to resolve the loader?

I am converting a working WebApp project to use a Function App instead. While I can use SQLite with EF Core on the Web App, the Function App fails. I used the latest EntityFramework.SQLite.Core libraries. I am deploying to a local Docker container so the folder structure is as it would be on Azure. Here is my test project showing the issue.
I copied the database to the /home directory but to no avail. I expect the Seed process to pass the check for !Employees.Any() and if true then seed the database with the CSV mock data file. But the first attempt to access the database with Employees.Any() gives the error:
DllNotFoundException: Unable to load shared library 'e_sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libe_sqlite3: cannot open shared object file: No such file or directory
How to get around this? It would be a way to cheaply host an API.

Error deploying to azure app service - "specified path, file name, or both are too long. The fully qualified file name must be < 260 characters"

I was trying to deploy my web app to a web app service I created in Azure services portal. I was doing it through Visual Studio Code with the help of Azure extensions (idk if that's important to mention or no). I got this error:
"The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters"
Unfortunately, I can not change file names or move the project to a different folder. What can I do to fix this issue? Thanks in advance :)
Please check if the below steps help to fix the issue:
If it is Node JS Web App, delete the folder called node_modules within the project folder. Reload the solution > Rebuild and publish to the Azure. In the Azure Portal > Web App > Console - run the command npm install which adds the dependencies within that project with the folder called node_modules.
If possible, try to move your projects/solutions to the root directory or to the short directory path.
According to this similar issue reported in the GitHub Repo-Azure Web App, you can include a setting in publish profile file like:
<PublishTempFolderName>i2</PublishTempFolderName>
Check that reference when using the above setting, some global settings need to be applied given on the GitHub Repo
(OR) Enable the policy state of Enable NTFS long paths in the Local Group Policy Editor and check once.

Azure Web Job Code looking for idyunnoo.f2h folder

I have a continuous web job and we have a certificates which are included as part of build. Build contains certificates inside a certificates but I got a below error
Could not find file
D:\local\Temp\jobs\continuous\MyWebJobProject\idyunnoo.f2h\Certificates\INT\XXXX.p12
in actual build certificates folder present in MyWebJobProject folder , folder structure is
MyWebJobProject\ Certificates\INT\XXXX.p12
I am not sure why code is checking inside idyunnoo.f2h folder and not sure when this kind of folders will create in azure web job
in my code we using AppDomain.CurrentDomain.BaseDirectory to find path of Certificate
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Certificates\Production\XXXX.p12");
Take my screenshot as an example, when you post your webjob, make sure that your certificates folder is under the Debug folder, and then package the Debug folder. There is no problem with your code. I tested it with your method. It should be the wrong path for the certificate.
Your folder structure is MyWebJobProject\Certificates\INT\XXXX.p12, So you should build your program. And rename Debug to MyWebJobProject, then compress files into zip format for upload. Make sure Certificates folder is under MyWebJobProject folder.

Error while publishing Xamarin.iOS IPA in Application Loader

When I am trying to deliver my app through Application Loader I get multiple errors saying:
ERROR ITMS-90171: "Invalid Bundle Structure - The binary file myapp.app/SwiftFrameworkSimulator/libsswiftCoreLocation.dylib" is not permitted.
I see these files are packaged into my app, how do I stop them from getting packaged into my .ipa? What are these files, and how to solve this issue?
I fixed the issue by manually deleting the SwiftFrameworkSimulator folder and it´s content from the archive, but I don´t know why such thing would be added in the first place.

Metadata file could not be opened -- PE image doesn't contain managed metadata

In azure functions I uploaded private dll's to bin folder using following instructions
If you need to reference a private assembly, you can upload the assembly file into a bin folder relative to your function and reference it by using the file name (e.g. #r "MyAssembly.dll").
but I when run the function, I am getting this error for every dll. "Metadata file could not be opened -- PE image doesn't contain managed metadata"
Looks like you're adding references to native binaries as well. Your references must be .NET assemblies. If you're deploying native indirect dependencies, you don't need to reference those from your function script.
UPDATE: There as a defect in the last portal deployment causing the content of files uploaded in the portal to be prefixed and suffixed with multipart form data, invalidating files.
The issue has been fixed and is being rolled out, but in the meantime, please upload the files using Kudu to workaround this issue. You can find more information about the problem here (and by following the issue link)
I also faced the same issue while building MAUI app in android platform. A native module was present in the project with .so extension. But a windows native DLL also present in the project for the purpose for running the same project in windows. Excluding the windows native DLL while building running in android fixed the issue. Sometimes I have to close the project and delete bin and obj folder and then rebuild the project to get rid of this issue.

Resources