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.

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

Preview

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

Examples

Cancel job j1

az cosmosdb copy cancel -g "rg1" --account-name "acc1" --job-name "j1"

Required Parameters

--account-name -a

Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.

--job-name -n

Name of the container copy job.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb copy complete

Preview

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

Examples

Complete job j1

az cosmosdb copy complete -g "rg1" --account-name "acc1" --job-name "j1"

Required Parameters

--account-name -a

Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.

--job-name -n

Name of the container copy job.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb copy create

Preview

Command group 'cosmosdb copy' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Creates a container copy job.

az cosmosdb copy create --resource-group
                        --src-account
                        [--dest-account]
                        [--dest-cassandra]
                        [--dest-mongo]
                        [--dest-mongo-vcore]
                        [--dest-nosql]
                        [--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 in different account

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 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

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--src-account

Name of the Azure Cosmos DB source database account.

Optional Parameters

--dest-account

Name of the Azure Cosmos DB destination database account.

--dest-cassandra

Destination table.

Usage: --dest-cassandra keyspace=XX table=XX' keyspace: Keyspace name. table: Table name.

--dest-mongo

Destination collection.

Usage: --dest-mongo database=XX collection=XX' database: Database name. collection: Collection name.

--dest-mongo-vcore

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.

--dest-nosql

Destination container.

Usage: --dest-nosql database=XX container=XX' database: Database name. container: Container name.

--job-name -n

Name of the Data Transfer Job. A random job name will be generated if not passed.

--mode

Copy Mode (Online / Offline).

Default value: Offline
--src-cassandra

Source table.

Usage: --src-cassandra keyspace=XX table=XX' keyspace: Keyspace name. table: Table name.

--src-mongo

Source collection.

Usage: --src-mongo database=XX collection=XX' database: Database name. collection: Collection name.

--src-nosql

Source container.

Usage: --src-nosql database=XX container=XX' database: Database name. container: Container name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb copy list

Preview

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

--account-name -a

Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb copy pause

Preview

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

Examples

Pause job j1

az cosmosdb copy pause -g "rg1" --account-name "acc1" --job-name "j1"

Required Parameters

--account-name -a

Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.

--job-name -n

Name of the container copy job.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb copy resume

Preview

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

Examples

Resume job j1

az cosmosdb copy resume -g "rg1" --account-name "acc1" --job-name "j1"

Required Parameters

--account-name -a

Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.

--job-name -n

Name of the container copy job.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az cosmosdb copy show

Preview

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

--account-name -a

Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.

--job-name -n

Name of the container copy job.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.