|
1 | 1 | # Example `migrationsettings.json` Files
|
2 | 2 |
|
3 | 3 | ## JSON to Cosmos-NoSQL
|
| 4 | + |
4 | 5 | ```json
|
5 | 6 | {
|
6 | 7 | "Source": "json",
|
7 | 8 | "Sink": "cosmos-nosql",
|
8 |
| - "SourceSettings": { |
9 |
| - "FilePath": "https://mytestfiles.local/sales-data.json" |
10 |
| - }, |
11 |
| - "SinkSettings": { |
12 |
| - "ConnectionString": "AccountEndpoint=https://...", |
13 |
| - "Database": "myDb", |
14 |
| - "Container": "myContainer", |
15 |
| - "PartitionKeyPath": "/id", |
16 |
| - "RecreateContainer": true, |
17 |
| - "WriteMode": "Insert", |
18 |
| - "CreatedContainerMaxThroughput": 5000, |
19 |
| - "IsServerlessAccount": false |
20 |
| - } |
| 9 | + "SourceSettings": { |
| 10 | + "FilePath": "https://mytestfiles.local/sales-data.json" |
| 11 | + }, |
| 12 | + "SinkSettings": { |
| 13 | + "ConnectionString": "AccountEndpoint=https://...", |
| 14 | + "Database": "myDb", |
| 15 | + "Container": "myContainer", |
| 16 | + "PartitionKeyPath": "/id", |
| 17 | + "RecreateContainer": true, |
| 18 | + "WriteMode": "Insert", |
| 19 | + "CreatedContainerMaxThroughput": 5000, |
| 20 | + "IsServerlessAccount": false |
| 21 | + } |
21 | 22 | }
|
22 | 23 | ```
|
23 | 24 |
|
24 | 25 | ## Cosmos-NoSQL to JSON
|
| 26 | + |
25 | 27 | ```json
|
26 | 28 | {
|
27 | 29 | "Source": "Cosmos-NoSql",
|
28 | 30 | "Sink": "JSON",
|
29 |
| - "SourceSettings": |
30 |
| - { |
31 |
| - "ConnectionString": "AccountEndpoint=https://...", |
32 |
| - "Database":"cosmicworks", |
33 |
| - "Container":"customers", |
34 |
| - "IncludeMetadataFields": true |
35 |
| - }, |
36 |
| - "SinkSettings": |
37 |
| - { |
38 |
| - "FilePath": "c:\\data\\cosmicworks\\customers.json", |
39 |
| - "Indented": true |
40 |
| - } |
| 31 | + "SourceSettings": |
| 32 | + { |
| 33 | + "ConnectionString": "AccountEndpoint=https://...", |
| 34 | + "Database":"cosmicworks", |
| 35 | + "Container":"customers", |
| 36 | + "IncludeMetadataFields": true |
| 37 | + }, |
| 38 | + "SinkSettings": |
| 39 | + { |
| 40 | + "FilePath": "c:\\data\\cosmicworks\\customers.json", |
| 41 | + "Indented": true |
| 42 | + } |
41 | 43 | }
|
42 | 44 | ```
|
43 | 45 |
|
44 | 46 | ## MongoDB to Cosmos-NoSQL
|
| 47 | + |
45 | 48 | ```json
|
46 | 49 | {
|
47 | 50 | "Source": "mongodb",
|
48 | 51 | "Sink": "cosmos-nosql",
|
49 |
| - "SourceSettings": { |
50 |
| - "ConnectionString": "mongodb://...", |
51 |
| - "DatabaseName": "sales", |
52 |
| - "Collection": "person" |
53 |
| - }, |
54 |
| - "SinkSettings": { |
55 |
| - "ConnectionString": "AccountEndpoint=https://...", |
56 |
| - "Database": "users", |
57 |
| - "Container": "migrated", |
58 |
| - "PartitionKeyPath": "/id", |
| 52 | + "SourceSettings": { |
| 53 | + "ConnectionString": "mongodb://...", |
| 54 | + "DatabaseName": "sales", |
| 55 | + "Collection": "person" |
| 56 | + }, |
| 57 | + "SinkSettings": { |
| 58 | + "ConnectionString": "AccountEndpoint=https://...", |
| 59 | + "Database": "users", |
| 60 | + "Container": "migrated", |
| 61 | + "PartitionKeyPath": "/id", |
59 | 62 | "ConnectionMode": "Direct",
|
60 |
| - "WriteMode": "UpsertStream", |
61 |
| - "CreatedContainerMaxThroughput": 8000, |
62 |
| - "UseAutoscaleForCreatedContainer": false |
63 |
| - } |
| 63 | + "WriteMode": "UpsertStream", |
| 64 | + "CreatedContainerMaxThroughput": 8000, |
| 65 | + "UseAutoscaleForCreatedContainer": false |
| 66 | + } |
64 | 67 | }
|
65 | 68 | ```
|
66 | 69 |
|
67 | 70 | ## SqlServer to AzureTableAPI
|
| 71 | + |
68 | 72 | ```json
|
69 | 73 | {
|
70 | 74 | "Source": "SqlServer",
|
71 | 75 | "Sink": "AzureTableApi",
|
72 |
| - "SourceSettings": { |
73 |
| - "ConnectionString": "Server=...", |
74 |
| - "QueryText": "SELECT Id, Date, Amount FROM dbo.Payments WHERE Status = 'open'" |
75 |
| - }, |
76 |
| - "SinkSettings": { |
77 |
| - "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=...", |
78 |
| - "Table": "payments", |
79 |
| - "RowKeyFieldName": "Id" |
80 |
| - } |
| 76 | + "SourceSettings": { |
| 77 | + "ConnectionString": "Server=...", |
| 78 | + "QueryText": "SELECT Id, Date, Amount FROM dbo.Payments WHERE Status = 'open'" |
| 79 | + }, |
| 80 | + "SinkSettings": { |
| 81 | + "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=...", |
| 82 | + "Table": "payments", |
| 83 | + "RowKeyFieldName": "Id" |
| 84 | + } |
81 | 85 | }
|
82 | 86 | ```
|
83 | 87 |
|
84 | 88 | ## Cosmos-NoSQL to SqlServer
|
| 89 | + |
85 | 90 | ```json
|
86 | 91 | {
|
87 | 92 | "Source": "cosmos-nosql",
|
88 | 93 | "Sink": "sqlserver",
|
89 |
| - "SourceSettings": |
90 |
| - { |
91 |
| - "ConnectionString": "AccountEndpoint=https://...", |
92 |
| - "Database":"operations", |
93 |
| - "Container":"alerts", |
94 |
| - "PartitionKeyValue": "jan", |
| 94 | + "SourceSettings": |
| 95 | + { |
| 96 | + "ConnectionString": "AccountEndpoint=https://...", |
| 97 | + "Database":"operations", |
| 98 | + "Container":"alerts", |
| 99 | + "PartitionKeyValue": "jan", |
95 | 100 | "Query": "SELECT a.name, a.description, a.count, a.id, a.isSet FROM a"
|
96 |
| - }, |
97 |
| - "SinkSettings": |
98 |
| - { |
99 |
| - "ConnectionString": "Server=...", |
100 |
| - "TableName": "Import", |
101 |
| - "ColumnMappings": [ |
102 |
| - { |
103 |
| - "ColumnName": "Name" |
104 |
| - }, |
105 |
| - { |
106 |
| - "ColumnName": "Description" |
107 |
| - }, |
108 |
| - { |
109 |
| - "ColumnName": "Count", |
110 |
| - "SourceFieldName": "number" |
111 |
| - }, |
112 |
| - { |
113 |
| - "ColumnName": "Id" |
114 |
| - }, |
115 |
| - { |
116 |
| - "ColumnName": "IsSet", |
117 |
| - "AllowNull": false, |
118 |
| - "DefaultValue": false |
119 |
| - } |
120 |
| - ] |
121 |
| - } |
| 101 | + }, |
| 102 | + "SinkSettings": |
| 103 | + { |
| 104 | + "ConnectionString": "Server=...", |
| 105 | + "TableName": "Import", |
| 106 | + "ColumnMappings": [ |
| 107 | + { |
| 108 | + "ColumnName": "Name" |
| 109 | + }, |
| 110 | + { |
| 111 | + "ColumnName": "Description" |
| 112 | + }, |
| 113 | + { |
| 114 | + "ColumnName": "Count", |
| 115 | + "SourceFieldName": "number" |
| 116 | + }, |
| 117 | + { |
| 118 | + "ColumnName": "Id" |
| 119 | + }, |
| 120 | + { |
| 121 | + "ColumnName": "IsSet", |
| 122 | + "AllowNull": false, |
| 123 | + "DefaultValue": false |
| 124 | + } |
| 125 | + ] |
| 126 | + } |
| 127 | +} |
| 128 | +``` |
| 129 | + |
| 130 | +## Cosmos-NoSQL to Json-AzureBlob (Using RBAC) |
| 131 | + |
| 132 | +```json |
| 133 | +{ |
| 134 | + "Source": "Cosmos-nosql", |
| 135 | + "Sink": "Json-AzureBlob", |
| 136 | + "SourceSettings": { |
| 137 | + "UseRbacAuth": true, |
| 138 | + "Database": "operations", |
| 139 | + "Container": "alerts", |
| 140 | + "PartitionKeyValue": "jan", |
| 141 | + "AccountEndpoint": "https://<databaseaccount>.documents.azure.com", |
| 142 | + "EnableInteractiveCredentials": true, |
| 143 | + "IncludeMetadataFields": false, |
| 144 | + "Query": "SELECT a.name, a.description, a.count, a.id, a.isSet FROM a" |
| 145 | + }, |
| 146 | + "SinkSettings": { |
| 147 | + "UseRbacAuth": true, |
| 148 | + "ContainerName": "operations-archive", |
| 149 | + "AccountEndpoint": "https://<storage-account>.blob.core.windows.net", |
| 150 | + "EnableInteractiveCredentials": true, |
| 151 | + "BlobName": "jan-alerts" |
| 152 | + }, |
| 153 | + "Operations": [ |
| 154 | + ] |
122 | 155 | }
|
123 | 156 | ```
|
0 commit comments