Trying to connect to SQL Server using mwaa - I'm not able to connect when I try to pass instance with host like host/instance using mssqlhook

75 views Asked by At

I am trying to pass a connection string from the secrets manager to mssqlhook like this

mssql+pyodbc://username:password@host\instance:port/schema 

When I tried it without instance in a lower environment, it worked fine, but in our higher environment, we have an instance when I try to connect manually to SQL Server, it's working.

But when I am using in airflow code with help of mssqlhook I get an error due to the \ - I tried \\ and also // but that did not work either.

enter image description here

Error message:

enter image description here

Can anyone help me how to pass the connection string with instance?

0

There are 0 answers