You can create the cosmosdb account using the ARM/Bicep template and then try seeding data with your custom logic.
I have a sample setup for the same
.
async function populateDb(data, collectionName) {
MongoClient.connect(
endpoint,
{
useNewUrlParser: true,
useUnifiedTopology: true,
sslValidate: false,
},
(error, client) => {
if (error) {
throw error;
}
database = client.db("yourdb");
collection = database.collection(collectionName);
let batch = collection.initializeOrderedBulkOp();
for (let i = 0; i <= data.length; i += 1) {
if (data[i]) {
batch.insert(data[i]);
}
}
batch.execute().then(() => console.log("Seeding completed on " + collectionName + " Collection", new Date().toLocaleString()))
.c
});
});
};