I am currently working on an azure function that connects to a odbc driver. I have one locally called 'Dobbe WMS productie' and i am using the following code to connect to it.
using(odbcConnection conn = new OdbcConnection("DSN=Dobbe WMS productie"))
{
conn.Open();
// performs some actions
conn.Close();
}
Locally this works just fine. Now I published this to azure and it is not working, as i expected. The problem is, I cant find anything to solve my issue. Is there anyone that can help me with this?
EDIT:
My full error message: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
I opened the ODBC-datasources on windows -> System-DSN -> add and then choose the postgresql ansi driver. Filled out the basics in the form and clicked on save
I have also tried Npgsl and got the following error: The remote certificate is invalid according to the validation procedure.
my connection string looks something like this: Server=address;Port=5432;Database=dbname;User Id=username;Password=password;SslMode=Require