One workable pattern in TestComplete is to keep Cosmos DB access outside the UI test code: install the Cosmos DB ODBC driver on the runner, create a system DSN, and use ADO from a script unit to run parameterized queries. If ODBC is blocked, call the REST API with WinHTTP and build the authorization header in a helper function. Store the key in a project environment variable, not in the script.