I am trying to add a connection string for a SQL server instance for an Azure Function (although I have tried App Service as well). I believe it is not escaping the backslash for the instance.
My connection string that is not working is:
Server=dbname\test;Database=ABC;User Id=azure;password=xxx
I have tested it from my development environment, and it works fine, but when I use it in Azure connection string it does not.
I have used the same connection (with different user and password) with the root server name and it works fine.
Server=dbname;Database=DEF;User Id=azure;password=yyy
Being able to connect from my development environment shows that the server is setup to accept connections, and being able to connect to the root server and not the instance shows that their is not a network issue from Azure to my SQL server. I think the connection string is not able to escape the "\".
I have tried putting 2 backslashes to escape the connection string, and still no luck
Server=dbname\\test;Database=ABC;User Id=azure;password=xxx
Does anyone know if this is a known issue, or is there a special way to enter a connection string for an SQL that has an instance?
Also, to easily test this, you can add the connection string in the configuration page under Connection String. Next go to 'Diagnose and solve problems' then 'diagnostic tools' then 'Check Connection Strings'. Azure Functions or App Service will automatically check the connection.