Azure / azure-functions-extension-bundles

Azure Functions Extension Bundles
MIT License
70 stars 52 forks source link

SQL Trigger for Java not supported in Microsoft.Azure.Functions.ExtensionBundle 4.x #332

Closed NLSbha2 closed 11 months ago

NLSbha2 commented 11 months ago

Hi, When using Microsoft.Azure.Functions.ExtensionBundle The SQL Trigger is does not work for Java applications. The function doesn't get triggered. The Microsoft.Azure.Functions.ExtensionBundle.Preview supports this. However the feature was released: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-azure-sql-trigger?tabs=isolated-process%2Cportal&pivots=programming-language-java

Charles-Gagnon commented 11 months ago

Hello @NLSbha2 - currently we are in the process of GA'ing SQL Trigger support, so it not being in the stable extension bundle is expected for the moment. The docs just got a little ahead of the release process, but we hope to have it fully released soon!

niravassar-hitrust commented 10 months ago

hello do you have an expected release time for the @SqlTrigger. I have cobbled together an example for playing with it, but am running into this error:

[2023-12-19T22:35:07.527Z] System.Private.CoreLib: Exception while executing function: Functions.EmployeeTrigger. System.Private.CoreLib: Result: Failure
Exception: ClassCastException: class com.microsoft.azure.functions.worker.binding.ExecutionContextDataSource cannot be cast to class java.lang.String (com.microsoft.azure.functions.worker.binding.ExecutionContex
tDataSource is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
Stack: java.lang.ClassCastException: class com.microsoft.azure.functions.worker.binding.ExecutionContextDataSource cannot be cast to class java.lang.String (com.microsoft.azure.functions.worker.binding.Execution
ContextDataSource is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
Charles-Gagnon commented 10 months ago

Are you using the Preview bundle? That should still work to at least verify that your function is written correctly. The error you're getting isn't one I immediately recognize, but it seems like a separate issue at first glance. Maybe related to https://github.com/Azure/azure-functions-java-worker/issues/315? @lucyzhang929 Is this an error you recognize?

If you're still unable to figure it out, please open a new issue for investigation. And if you could include your function code that would help track down what's going on here.

lucyzhang929 commented 10 months ago

I haven't seen this error before. @niravassar-hitrust As Charles suggested, please open a new issue and share your function code if you continue to see the error.

niravassar-hitrust commented 10 months ago

Thanks for the attention. Yes we have been looking into this issue, and from what i can tell its an infrastructure issue throwing an exception with the java-worker library, probably something you all will have to look into. I will create another issue here in github, and post detailed instructions on my setup of local db with Azure Sql Server (local), and also the commands i ran, along with a zip of my java function app project. I hope this will help. Expect a post today.

niravassar-hitrust commented 10 months ago

filed it in https://github.com/Azure/azure-functions-extension-bundles/issues/335