1
votes

Is there a way to backup a cosmos DB by using an azure function and save the .JSON file in a Azure blob storage

2
This question is a bit too open-ended. What have you tried so far and what's your issue now? - Mikhail Shilkov
My backup strategy is running with a scheduled task in a local machine, i'd like to replaced with a azure function and blob storage and if possible, how can be done. - Kingsadrr
Yes there is an option to do it that way. But please start by putting in some effort. There is plenty of good docs available. - Peter Bons
@giantLincecum Hi,any updates now? - Jay Gong
Hey @JayGong thanks for your suggestion, sounds like a good solution, I'll try them out. - Kingsadrr

2 Answers

4
votes

For sure , you can create a Time-Trigger Azure Function to run your backup job. Just use sdk to get the data from your cosmos db and save them as files into blob storage.

Another choice is Azure Data Factory.

Cosmos DB Output:

enter image description here

Blob Storage Input:

enter image description here

Backup pipeline:

enter image description here

Result:

enter image description here

Hope it helps you.

0
votes

check out Azure Data Factory. I think it's pretty good and easy to use it for backup functionality.