ODBC SSL Security error while making connection from Azure web apps

Venkatesh K 6 Reputation points
2019-12-06T11:02:38.3+00:00

HI Team,
Recently we have migrated our Azure project with latest SDK(2.9), .Net Framework 4.7.2 and VS 2019.
When we debug the code locally ODBC connection is working fine. But once we hosted into azure cloud then exception is throwing when app is making sql connection through ODBC service. The problems seems to be SSL security issue in Web Instance role wise.
Exception:

-----------

System.Data.OleDb.OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error. Invalid connection string attribute at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open()

My ODBC SQL Connection method:

--------------------------------------

OleDbConnection oledbCon = new OleDbConnection("Provider=SQLOLEDB; Data Source=server_name; Initial Catalog=db_name; User Id=test; pwd=*****; Connect Timeout=300; Min Pool Size=350; Max Pool Size=3500");
if (oledbCon.State != ConnectionState.Open)
oledbCon.Open();

Please help us to solve this issue.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,875 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 15,856 Reputation points
    2019-12-12T00:14:37.417+00:00

    Hi,
    Welcome to the Microsoft Q&A (Preview) platform. Happy to answer your question.

    Looks like you're using SQLOLEDB in your ODBC SQL Connection method. The previous Microsoft OLE DB Provider for SQL Server (SQLOLEDB) and SQL Server Native Client OLE DB provider (SQLNCLI) remains deprecated and it is not recommended to use for new development work. You need to use OLE DB Driver for SQL Server.

    The OLE DB Driver for SQL Server is a stand-alone data access application programming interface (API), used for OLE DB, that was introduced in SQL Server 2005 (9.x). OLE DB Driver for SQL Server delivers the SQL OLE DB driver in one dynamic-link library (DLL). It also provides new functionality above and beyond that supplied by the Windows Data Access Components (Windows DAC, formerly Microsoft Data Access Components, or MDAC). The OLE DB Driver for SQL Server can be used to create new applications or enhance existing applications that need to take advantage of features introduced in SQL Server 2005 (9.x), such as multiple active result sets (MARS), user-defined data types (UDT), query notifications, snapshot isolation, and XML data type support.

    You can download Microsoft OLE DB Driver for SQL Server here.

    Also, please update your .Net framework to the latest version(4.8).

    Hope that helps,

    Grace