Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding paremeter to cosmosdb query SourceSettings #96

Open
olivierbachard opened this issue Nov 20, 2023 · 1 comment
Open

Adding paremeter to cosmosdb query SourceSettings #96

olivierbachard opened this issue Nov 20, 2023 · 1 comment

Comments

@olivierbachard
Copy link

olivierbachard commented Nov 20, 2023

Hello,
I would need to export data from cosmosdb using a query where I can pass some parameter at execution, but I did not manage to find a way to do it. Here is a sample of my migrationsettings.json :

{
  "Source": "cosmos-nosql",
  "Sink": "cosmos-nosql",
  "SourceSettings": {
      "ConnectionString": "<source_ConnectionString>",
      "Database": "<source_Database>"
  },
  "SinkSettings": {
      "ConnectionString": "<dest_ConnectionString>",
      "Database": "<dest_Database>"
  },
  "Operations": [
    {
      "SourceSettings": {
          "Query": "SELECT * FROM c WHERE c.someProperty= '<my_dynamic_parameter>'",
          "Container": "<soure_container>"
      },
      "SinkSettings": {
          "Container": "<dest_container>",
	  "PartitionKeyPath": "/id"
      }
    }
  ]
}

Is it possible to do it ? If not, is there a work around I could use to achieve this ?
Thank you for your help.

@crpietschmann
Copy link
Collaborator

The data migration tool reads the json configuration when it runs. To get what you're trying to do, you'll can write a script to modify the json configuration prior to executing the data migration tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants