0
votes

I'm trying to export data from CosmosDB to a different collection, by query.

I created a function with that query as CosmosDB binding parameter.

The function keeps timing out because the query results set is too large, and takes more than 5 minutes to retrieve.

Any suggestions how to run the export using Azure functions? Or should I take a different approach?

2
Functions are for event-based scenarios... Not the best option for batch operations.Mikhail Shilkov
Otherwise use a timertriggerThomas

2 Answers

1
votes

I'm trying to export data from CosmosDB to a different collection, by query.

According to your description, maybe you could try to use DocumentDB Data Migration Tool to achieve your goal. You could choose the Source Information and Target Information.And you could add specific query statement by choosing Enter Query radio button. For more details, please read this article.

enter image description here

0
votes

You can increase the timeout of your function to a max of 10minutes in the Host file, but I agree with Mikhail, the trigger to Functions are intended for smaller workloads. You can create a durable function if you absolutely must have it in a function, but then you dont use the trigger but rather select from within the function.