DocumentDB - JSON Files

Let’s take a look at a simple example in which we will see how the Migration Tool can import JSON files. We have three JSON files in JSON folders on Desktop.

JSON Files

Step 1 − Go the Migration tool and select Add Folders → Single.

select Single

It will display the Browse for Folder dialog.

Browse For Folder

Step 2 − Select the folder which contains the JSON files and click OK.

JSON Files Folder

Step 3 − Click ‘Next’.

Specify Target Information

Step 4 − Specify the Connection String from your DocumentDB account which can be found from the Azure Portal.

Specify Connection String

Step 5 − Specify the Primary Connection String and don’t forget to add the database name at the end of connection string.

Add Database name

Step 6 − Specify the Collections to which you want to add the JSON files.

Step 7 − Click on the Advanced Options and scroll down the page.

Click Advanced option

Step 8 − Specify the indexing policy, let’s say Range indexing policy.

Range indexing policy

Step 9 − Click ‘Next’ to continue.

click Next

Step 10 Click ‘Next’ again to continue.

Confirm Import Setting

Here you can see the summary.

Step 11 − Click on the ‘Import’ button.

click Import

It will start importing the data once it is completed. Then you can see on Azure Portal that the three JSON files data are imported to DocumentDB account as shown in the following screenshot.

JSON File Imported