SQL trigger not working for java function apps
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với hàm Java được hiển thị trong issue, host.json và extensions.csproj đã tạo, sau đó so sánh cấu hình của chúng với Azure SQL trigger tutorial được liên kết và dependency azure-functions-java-library-sql đã thêm. Tái hiện binding sqlTrigger bị thiếu và platform error Microsoft.Data.SqlClient bằng các phiên bản Core Tools và .NET được báo cáo. Hoàn tất khi Java SQL trigger được phát hiện và listener của nó khởi động mà không gặp một trong hai lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I try to create a SQL trigger in a java function app. However I get this error:
Azure Functions Core Tools
Core Tools Version: 4.0.5413 Commit hash: N/A (64-bit)
Function Runtime Version: 4.25.3.21264
[2023-10-23T10:55:58.376Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[2023-10-23T10:55:58.403Z] The 'MySQLTrigger' function is in error: The binding type(s) 'sqlTrigger' were not found in the configured extension bundle. Please ensure the type is correct and the correct version of extension bundle is configured.
For detailed output, run func with --verbose flag.
Here is my java code:
@FunctionName("MySQLTrigger")
public void run(
@SQLTrigger(
name = "items",
tableName = "[dbo].[TodoItem]",
connectionStringSetting = "SqlConnectionString")
TodoItems[] items,
final ExecutionContext context) {
...
}
Here is my host.json:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
I also tried removing the extension bundle and installing the sql extension directly by running this command:
func extensions install --package Microsoft.Azure.WebJobs.Extensions.Sql --version 3.0.396
which creates a file named extensions.csproj in my root folder and results in this error message:
[2023-10-23T11:03:11.118Z] Failed to start SQL trigger listener for table: 'partner.kontaktmapping', function ID: '302b12208735c890'. Exception: System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on
this platform.
[2023-10-23T11:03:11.119Z] at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString)
[2023-10-23T11:03:11.120Z] at Microsoft.Azure.WebJobs.Extensions.Sql.SqlTriggerListener`1.StartAsync(CancellationToken cancellationToken)
[2023-10-23T11:03:11.121Z] The listener for function 'Functions.PartnerSenderCosmosDBTrigger' was unable to start.
[2023-10-23T11:03:11.123Z] The listener for function 'Functions.PartnerSenderCosmosDBTrigger' was unable to start. Microsoft.Data.SqlClient: Microsoft.Data.SqlClient is not supported on this platform.
This is the output of dotnet --info
dotnet --info
.NET SDK:
Version: 7.0.402
Commit: 791db8e2d8
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.402\
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
I'd expect SQLTrigger to work as stated in this tutorial.
In addition to this tutorial I had to install the additional maven dependencies azure-functions-java-library-sql that was not mentioned in the tutorial. I have absolutely no experience working with dotnet and its runtime environment and development kits, so I might have done a mistake somewhere or missed some more steps needed.
If you need some more information on my setup, please let me know. I'm looking forward to any news on this.
- Ngôn ngữ chính
- Java
- Star
- 45
- Fork
- 49
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-functions-java-library
-
[KafkaTrigger] Errors while retrieving function metadata using BindingName in cardinality=Cardinality.MANY modeCó thể đã có người làm @arnabnandy7 đã nhận 67 ngày trước. Đang mởarea:java-functions
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Azure/azure-functions-java-library#229 · 1 bình luận ·
-
[BUG] Duplicated field "client" in BlockBlobClient, raises gson IllegalArgumentExceptionCó thể đã có người làm @arnabnandy7 đã nhận 67 ngày trước. Đang mởarea:java-functions
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Azure/azure-functions-java-library#222 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
EventGridOutput missing 'connection' attribute to use Managed IdentitiesCó thể đã có người làm @arnabnandy7 đã nhận 67 ngày trước. Đang mởarea:java-functions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
area:java-functions
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của Azure/azure-functions-java-library
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/rocketmq-dashboard#6716 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
DefaultRedisList.get(int) does not reject an index equal to the list sizeCó thể đã có người làm @ryujungkyun đã nhận hôm nay. Đang mởstatus: waiting-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
spring-projects/spring-data-redis#3471 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
:maddi-inspection-kotlin:test runs out of heap in a full maddi test run; exit 1 with no failing testĐang mởbuild/ci front-end:kotlin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
uwolfer/gerrit-intellij-plugin#768 ·
Maintainer thường phản hồi trong vòng 1 ngày