Db2 Connect

Expand all | Collapse all

Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

  • 1.  Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Tue April 27, 2021 03:22 PM
    I'm trying to use IBM.Data.DB2.Core.DB2Connection (3.1.0.400) in an azure function, but it's throwing an exception in the constructor when setting the connection string. This works fine outside of azure, but I get this error when testing locally with the azure functions runtime and in azure.

    How can I get this working?

    IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [] [IBM][CLI Driver] SQL10007N Message "0" could not be retrieved. Reason code: "6".

    at IBM.Data.DB2.Core.ConnSettingsFromXmlConfig.ProcessFromXmlConfig(DB2Connection connection, String dbname, String host, String port, String tmpClientEncAlg, String tmpAuthentication, String prevdb, String prevdb_ori, DB2ConnSettings& sSettings, DB2ConnSettingsInternal& sSettingsInternal, StringBuilder& modifiedValue)
    at IBM.Data.DB2.Core.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended)
    at IBM.Data.DB2.Core.DB2Connection.set_ConnectionString(String value)
    at IBM.Data.DB2.Core.DB2Connection..ctor(String connectionString)



    Here's the code:

    var db2Connection = new DB2Connection(connectionString) {SystemNaming = true};

    ------------------------------
    John Rummell
    ------------------------------


  • 2.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Tue May 04, 2021 04:10 AM
    Hi John,
     the Azure functions support is currently not available in Db2 .NET provider. It will be available in the upcoming release of .NET 5 and .NET Core 3.1.

    Thanks
    Vishwa

    ------------------------------
    Hosathota Vishwanatha
    ------------------------------



  • 3.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Tue May 04, 2021 09:19 AM
    Thanks, Hosathota!

    Do you have a timeline for the upcoming release? We're trying to move a number of scheduled tasks off of VMs and into Azure functions, and Db2 Connect is a big part of that plan. 


    ------------------------------
    John Rummell
    ------------------------------



  • 4.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Wed May 05, 2021 12:52 AM
    Hi John,
     we keep updating the packages on a need basis and when there are some important updates. Current planned update is around November time but if there are critical fixes to be provided, we will release much before that. We will keep you updated on the availability of Azure functions.

    Thanks
    Vishwa

    ------------------------------
    Hosathota Vishwanatha
    ------------------------------



  • 5.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Fri August 06, 2021 03:02 AM
    Edited by Hosathota Vishwanatha Fri August 06, 2021 03:06 AM
    Hi John,
    we have made some progress in supporting Azure Functions and a new blog will be created soon to explain the steps. Are you still looking for the support? What combination you are planning? We are working on a combination of Azure Functions with HttpTrigger and with .NET Core packages. Please let us know what combination you were trying.

    Thanks
    Vishwa




  • 6.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Thu August 19, 2021 02:19 PM
    Hi Vishwa

    We're interested in .NET Core timer trigger functions at the moment.

    Thanks!


    ------------------------------
    John Rummell
    ------------------------------



  • 7.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Fri August 20, 2021 02:10 AM
    Hi John,
     we recently published a blog which explains the steps needed deploy a Httptrigger based Azure Function. Please have a look and let us know if that helps.

    Thanks
    Vishwa


  • 8.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Fri August 20, 2021 08:14 AM
    Hi Vishwa

    Unfortunately, we need a Timer trigger. In the meantime, we're using webjobs and plan to move to functions once timer triggers are supported.

    Thanks!

    ------------------------------
    John Rummell
    ------------------------------



  • 9.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Mon August 23, 2021 05:04 AM
    Hi John,
     I did a quick verification with Time trigger on similar lines to Httptrigger and it worked fine. Though we claim explicit support for HttpTrigger, as long Azure Functions infrastructure stays same for other types, all others should work fine.

    Thanks
    Vishwa


  • 10.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted Mon August 23, 2021 08:45 AM
    Awesome, thank you!

    ------------------------------
    John Rummell
    ------------------------------



  • 11.  RE: Azure Function - SQL10007N Message "0" could not be retrieved. Reason code: "6"

    Posted 9 days ago
    I tried the steps you mentioned in the blog Azure Functions using Db2 .NET Core drivers (ibm.com).

    When I tried to test it in my local function emulator its asking for licensing. Here is the error "Message = "ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968\r\n".

    Do we need licensing to use the nuget package? if yes then how this will be used in the azure function?

    ------------------------------
    Rishi Gupta
    ------------------------------