Lesson Learned #271: ApplicationIntent parameter when is not available option in connection string
Today, I worked on a service request that our customer is using a 3rd party tool that has not option to specify the setting ApplicationIntent=Readonly in the connection string. The database is business critical tier with ReadScale feature enabled.
As you can see in the following diagram, If the SQL connection string is configured with ApplicationIntent=ReadOnly
, the application will be redirected to a read-only replica of that database or managed instance.
In the following link you can find more information about the read only replica: Read queries on replicas - Azure SQL Database & SQL Managed Instance | Microsoft Learn
Using this 3rd party tool, there is not possible to specify additional parameter settings like we have in SQL Server Management Studio,
Testing any available option, we suggested to include in the Host Name section the parameter after the name servername.database.windows.net;ApplicationIntent=Readonly and it works!. After connecting to the database, I verified that we are connected to a read-only replica using the following query: SELECT DATABASEPROPERTYEX(DB_NAME(), 'Updateability')
Most probably, in other situations will not work but, at least, in this scenario, our customer was able to, meanwhile this company works in other available option.
Enjoy!