az cosmosdb sql trigger

Manage Azure Cosmos DB SQL triggers.

Commands

az cosmosdb sql trigger create

Create an SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger delete

Delete the SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger list

List the SQL triggers under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger show

Show the details of a SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger update

Updates an Azure Cosmos DB SQL trigger.

az cosmosdb sql trigger create

Create an SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger create --account-name
                               --body
                               --container-name
                               --database-name
                               --name
                               --resource-group
                               [--operation {All, Create, Delete, Replace, Update}]
                               [--subscription]
                               [--type {Post, Pre}]

Examples

Create an Azure Cosmos DB SQL trigger.

az cosmosdb sql trigger create -g MyResourceGroup -a MyAccount -d MyDatabase -c MyContainer -n MyTrigger -b TriggerBody

Required Parameters

--account-name -a

Cosmosdb account name.

--body -b

Trigger body, you can enter it as a string or as a file, e.g., --body @triggerbody-file.json.

--container-name -c

Container name.

--database-name -d

Database name.

--name -n

Trigger name.

--resource-group -g

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

Optional Parameters

--operation

The operation of the trigger.

accepted values: All, Create, Delete, Replace, Update
--subscription

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

--type -t

Trigger type.

accepted values: Post, Pre

az cosmosdb sql trigger delete

Delete the SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger delete --account-name
                               --container-name
                               --database-name
                               --name
                               --resource-group
                               [--subscription]
                               [--yes]

Required Parameters

--account-name -a

Cosmosdb account name.

--container-name -c

Container name.

--database-name -d

Database name.

--name -n

Trigger name.

--resource-group -g

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

Optional Parameters

--subscription

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

--yes -y

Do not prompt for confirmation.

az cosmosdb sql trigger list

List the SQL triggers under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger list --account-name
                             --container-name
                             --database-name
                             --resource-group
                             [--query-examples]
                             [--subscription]

Required Parameters

--account-name -a

Cosmosdb account name.

--container-name -c

Container name.

--database-name -d

Database name.

--resource-group -g

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

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

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

az cosmosdb sql trigger show

Show the details of a SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger show --account-name
                             --container-name
                             --database-name
                             --name
                             --resource-group
                             [--query-examples]
                             [--subscription]

Required Parameters

--account-name -a

Cosmosdb account name.

--container-name -c

Container name.

--database-name -d

Database name.

--name -n

Trigger name.

--resource-group -g

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

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

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

az cosmosdb sql trigger update

Updates an Azure Cosmos DB SQL trigger.

az cosmosdb sql trigger update --account-name
                               --container-name
                               --database-name
                               --name
                               --resource-group
                               [--body]
                               [--operation {All, Create, Delete, Replace, Update}]
                               [--subscription]
                               [--type {Post, Pre}]

Required Parameters

--account-name -a

Cosmosdb account name.

--container-name -c

Container name.

--database-name -d

Database name.

--name -n

Trigger name.

--resource-group -g

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

Optional Parameters

--body -b

Trigger body, you can enter it as a string or as a file, e.g., --body @triggerbody-file.json.

--operation

The operation of the trigger.

accepted values: All, Create, Delete, Replace, Update
--subscription

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

--type -t

Trigger type.

accepted values: Post, Pre