I have the following requirement i want to capture record from cosmosDB and push it to blog storage.
This above problem i have solved with azure function cosmos DB trigger (that will capture any changes made to record in cosmos DB container).
How to capture full load?
requirement is i have to get all the record from cosmos DB container and push it to blog storage.
so the problem is cosmosDB trigger only capture if there is some change in record, so how i can achieve this full load.
For Full load i have create one python script also.
Reference: https://github.com/Azure/azure-cosmos-python
Reference Script: How To Update Record in Cosmos Db using python?
query_data = client.QueryItems(collection_link,
'SELECT * FROM ' + COSMOS_DB_COLLECTION_ID,
{'enableCrossPartitionQuery': True})
for item in query_data:
client.ReplaceItem(item['_self'], item, options=None)
so what actual my script is doing its taking all record and i am calling ReplaceItem for each record, but what i observed is azure function cosmos DB trigger won't capture changes of all record its capture few record only.
so is there problem with the script?