@mohamed benayad Thanks for reaching out. As you are using arcpy
module in your azure function and when there is a missing dependency, you should see the error message below in application insights (as per your logs shared) that you have configured for your function app. Whenever you receive 500 errors then you can always navigate to application insights logs to get more details on the actual exception in the case of 500 or any error code.
No module named 'arcpy'
If you have any requirement where you need to use any other packages that are not predefined in the functions, then you need to add the names or names (If the modules can be installed using pip) along with versions of the required packages to the requirements.txt file.
But in case if those module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.
To troubleshoot these types of errors you can always refer to this document.