az cosmosdb copy
Note
This reference is part of the cosmosdb-preview extension for the Azure CLI (version 2.17.1 or higher). The extension will automatically install the first time you run an az cosmosdb copy command. Learn more about extensions.
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Manage container copy job.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az cosmosdb copy cancel |
Cancel a container copy job. |
Extension | Preview |
| az cosmosdb copy complete |
Completes an online container copy job. |
Extension | Preview |
| az cosmosdb copy create |
Creates a container copy job on the source account by default. |
Extension | Preview |
| az cosmosdb copy list |
Get a container copy job. |
Extension | Preview |
| az cosmosdb copy pause |
Pause a container copy job. |
Extension | Preview |
| az cosmosdb copy resume |
Resume a container copy job. |
Extension | Preview |
| az cosmosdb copy show |
Get a container copy job. |
Extension | Preview |
az cosmosdb copy cancel
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Cancel a container copy job.
az cosmosdb copy cancel --account-name
--job-name
--resource-group
[--acquire-policy-token]
[--change-reference]
Examples
Cancel job j1
az cosmosdb copy cancel -g "rg1" --account-name "acc1" --job-name "j1"
Required Parameters
Azure Cosmos DB account hosting the job. Use the source account by default, or the destination for destination-hosted jobs.
Name of the container copy job.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cosmosdb copy complete
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Completes an online container copy job.
az cosmosdb copy complete --account-name
--job-name
--resource-group
[--acquire-policy-token]
[--change-reference]
Examples
Complete job j1
az cosmosdb copy complete -g "rg1" --account-name "acc1" --job-name "j1"
Required Parameters
Azure Cosmos DB account hosting the job. Use the source account by default, or the destination for destination-hosted jobs.
Name of the container copy job.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cosmosdb copy create
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Creates a container copy job on the source account by default.
Use the hosting account's subscription and resource group. Jobs are hosted on the source by default; set --host-copy-on-src false to host on the destination instead. For cross-account source-hosted copies, configure the source account's default managed identity with read-write access to the destination. For destination-hosted copies, configure the destination account's default managed identity with read access to the source. Manage jobs using the hosting account. MongoDB RU-to-vCore jobs are always hosted on the source account.
az cosmosdb copy create --resource-group
--src-account
[--acquire-policy-token]
[--change-reference]
[--dest-account]
[--dest-cassandra]
[--dest-mongo]
[--dest-mongo-vcore]
[--dest-nosql]
[--host-copy-on-src {false, true}]
[--job-name]
[--mode]
[--src-cassandra]
[--src-mongo]
[--src-nosql]
Examples
Copy Azure Cosmos DB API for NoSQL container in same account
az cosmosdb copy create -g "rg1" --job-name "j1" --src-account "acc1" --dest-account "acc1" --src-nosql database=db1 container=c1 --dest-nosql database=db2 container=c2
Copy Azure Cosmos DB API for NoSQL container to a different account, hosting the job on acc1 in rg1
az cosmosdb copy create -g "rg1" --job-name "j1" --src-account "acc1" --dest-account "acc2" --src-nosql database=db1 container=c1 --dest-nosql database=db2 container=c2
Copy Azure Cosmos DB API for NoSQL container, hosting the job on destination acc2 in rg2
az cosmosdb copy create -g "rg2" --job-name "j1" --src-account "acc1" --dest-account "acc2" --host-copy-on-src false --src-nosql database=db1 container=c1 --dest-nosql database=db2 container=c2
Copy Azure Cosmos DB API for Apache Cassandra table
az cosmosdb copy create -g "rg1" --job-name "j1" --src-account "acc1" --dest-account "acc1" --src-cassandra keyspace=k1 table=t1 --dest-cassandra keyspace=k2 table=t2
Copy Azure Cosmos DB API for MongoDB collection
az cosmosdb copy create -g "rg1" --job-name "j1" --src-account "acc1" --dest-account "acc1" --src-mongo database=d1 collection=c1 --dest-mongo database=d2 collection=c2
Copy Azure Cosmos DB API from MongoDB(RU) collection to Mongo(vCore) collection
az cosmosdb copy create -g "rg1" --job-name "j1" --src-account "acc1" --src-mongo database=d1 collection=c1 --dest-mongo-vcore database=d2 collection=c2 connectionStringKeyVaultUri=<link_to_Azure_KeyVault_secret>
Required Parameters
Name of the resource group containing the hosting account: source by default, or destination with --host-copy-on-src false.
Name of the Azure Cosmos DB source database account. Hosts the copy job by default.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Name of the Azure Cosmos DB destination database account.
Destination table.
Usage: --dest-cassandra keyspace=XX table=XX' keyspace: Keyspace name. table: Table name.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for Apache Cassandra table copy Arguments |
Destination collection.
Usage: --dest-mongo database=XX collection=XX' database: Database name. collection: Collection name.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for MongoDB (RU) collection copy Arguments |
Destination Mongo(vCore) collection.
Usage: --dest-mongo-vcore database=XX collection=XX connectionStringKeyVaultUri=XX' database: Database name. collection: Collection name. connectionStringKeyVaultUri: Link to Azure KeyVault secret containing connection string.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for MongoDB (vCore) collection copy Arguments |
Destination container.
Usage: --dest-nosql database=XX container=XX' database: Database name. container: Container name.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for NoSQL container copy Arguments |
Host the copy job on the source account. Set false to host on the destination instead. MongoDB RU-to-vCore jobs always use the source.
| Property | Value |
|---|---|
| Default value: | True |
| Accepted values: | false, true |
Name of the Data Transfer Job. A random job name will be generated if not passed.
Copy Mode (Online / Offline).
| Property | Value |
|---|---|
| Default value: | Offline |
Source table.
Usage: --src-cassandra keyspace=XX table=XX' keyspace: Keyspace name. table: Table name.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for Apache Cassandra table copy Arguments |
Source collection.
Usage: --src-mongo database=XX collection=XX' database: Database name. collection: Collection name.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for MongoDB (RU) collection copy Arguments |
Source container.
Usage: --src-nosql database=XX container=XX' database: Database name. container: Container name.
| Property | Value |
|---|---|
| Parameter group: | Azure Cosmos DB API for NoSQL container copy Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cosmosdb copy list
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get a container copy job.
az cosmosdb copy list --account-name
--resource-group
Examples
List all jobs
az cosmosdb copy list -g "rg1" --account-name "acc1"
Required Parameters
Azure Cosmos DB account hosting the job. Use the source account by default, or the destination for destination-hosted jobs.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cosmosdb copy pause
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Pause a container copy job.
az cosmosdb copy pause --account-name
--job-name
--resource-group
[--acquire-policy-token]
[--change-reference]
Examples
Pause job j1
az cosmosdb copy pause -g "rg1" --account-name "acc1" --job-name "j1"
Required Parameters
Azure Cosmos DB account hosting the job. Use the source account by default, or the destination for destination-hosted jobs.
Name of the container copy job.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cosmosdb copy resume
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Resume a container copy job.
az cosmosdb copy resume --account-name
--job-name
--resource-group
[--acquire-policy-token]
[--change-reference]
Examples
Resume job j1
az cosmosdb copy resume -g "rg1" --account-name "acc1" --job-name "j1"
Required Parameters
Azure Cosmos DB account hosting the job. Use the source account by default, or the destination for destination-hosted jobs.
Name of the container copy job.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cosmosdb copy show
Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get a container copy job.
az cosmosdb copy show --account-name
--job-name
--resource-group
Examples
Show details of job j1
az cosmosdb copy show -g "rg1" --account-name "acc1" --job-name "j1"
Required Parameters
Azure Cosmos DB account hosting the job. Use the source account by default, or the destination for destination-hosted jobs.
Name of the container copy job.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |