Problem is I have jobs configured in the on-prem SQL server to connect to this Azure database. So I want to know How can I configure my sqlcmd to use the newer version of ODBC i.e. ODBC version 17 by default?
You need to use the new version of SQLCMD, which will use the proper ODBC version too. When the path to SQLCMD (or any exe) is not qualified, Windows searches the directories specified by the PATH environment variable in order until the exe is found.
The search path can be changed under Control Panel-->System and Security-->System-->Advanced system settings. Click the Environment Variables button, select the Path system variable and then edit. Select the C:\Program Files\Microsoft SQL Server*Client SDK\ODBC\170\Tools\Binn
directory and press the "Move Up" button until it's before the other versions. I suggest you do the same for all of the *\170\*
directories. You may need to restart the machine after the change.