You would need to modify the config in order to make it work with the Mongo API, I have published a sample here.
here https://github.com/sajeetharan/cosmosdb-loopback4-sample.git
const Passwordconfig = {
name: 'db',
connector: 'mongodb',
url:
'mongodb://cosmosbookstorew4zuqbndb3qfq:' + pass + 'restofconnectionstring',
host: 'cosmosbookstorew4zuqbndb3qfq.mongo.cosmos.azure.com',
port: 10255,
useNewUrlParser: true,
ssl: true,
};