How to fix sqlTrigger for azure function

Sagar Kapadia 0 Reputation points
2023-11-10T21:41:44.94+00:00

Failed to start SQL trigger listener for table: 'dbo.ADADAPTED_PAYLOAD', function ID: 'cd373651592ded96'. Exception: System.ArgumentException: Keyword not supported: 'jdbc:sqlserver://maaa-elec-dev-westus-sqlsrv-01.database.windows.net:1433;database'.at Microsoft.Data.Common.DbConnectionOptions.

I am wondering why my jdbc connection string is not working for this sql trigger. is there a specific connection string way I have to use it? such as asp? I am using java for my azure function

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 27,540 Reputation points Microsoft Employee Moderator
    2023-11-14T05:32:43.0766667+00:00

    @Sagar Kapadia Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I understand that you have Azure Function with SQL Trigger which is failing with error: Failed to start SQL trigger listener for table: 'dbo.ADADAPTED_PAYLOAD', function ID: 'cd373651592ded96'. Exception: System.ArgumentException: Keyword not supported: 'jdbc:sqlserver://maaa-elec-dev-westus-sqlsrv-01.database.windows.net:1433;database'.at Microsoft.Data.Common.DbConnectionOptions.

    . It seems like the error message you’re seeing is due to the format of the connection string. The Azure SQL trigger listener expects a connection string in a specific format. For an Azure SQL database, the connection string should be in the following format:

    .

    
    Server=tcp:{your-server-name}.database.windows.net,1433;Initial Catalog={your-database-name};Persist Security Info=False;User ID={your-user-name};Password={your-password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
    

    Please replace {your-server-name}, {your-database-name}, {your-user-name}, and {your-password} with your actual server name, database name, user ID, and password respectively.
    .

    Please see the limitations and pre-requisites here. Ensure that you have followed it.

    .

    On a side note: The Azure SQL trigger for Functions is currently in preview and requires that a preview extension library or extension bundle is used. In consumption plan functions, automatic scaling is not available for SQL trigger. Use premium or dedicated plans for scaling benefits with SQL trigger.
    .

    If you continue to experience issues, I recommend checking the Azure SQL trigger documentation for more information and troubleshooting tips. Hope this helps! Let me know if you have any other questions.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members._

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.