你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az cosmosdb service

Note

此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 Learn more about extensions.

用于对服务执行操作的命令。

命令

名称 说明 类型 Status
az cosmosdb service create

创建 cosmosdb 服务资源。

Core GA
az cosmosdb service create (cosmosdb-preview 扩展)

创建 cosmosdb 服务资源。

Extension Preview
az cosmosdb service delete

删除给定的 cosmosdb 服务资源。

Core GA
az cosmosdb service delete (cosmosdb-preview 扩展)

删除给定的 cosmosdb 服务资源。

Extension Preview
az cosmosdb service list

列出帐户下的所有 cosmosdb 服务资源。

Core GA
az cosmosdb service list (cosmosdb-preview 扩展)

列出帐户下的所有 cosmosdb 服务资源。

Extension Preview
az cosmosdb service show

在帐户下获取 cosmosdb 服务资源。

Core GA
az cosmosdb service show (cosmosdb-preview 扩展)

在帐户下获取 cosmosdb 服务资源。

Extension Preview
az cosmosdb service update

更新 cosmosdb 服务资源。

Core GA
az cosmosdb service update (cosmosdb-preview 扩展)

更新 cosmosdb 服务资源。

Extension Preview

az cosmosdb service create

创建 cosmosdb 服务资源。

az cosmosdb service create --account-name
                           --name
                           --resource-group-name
                           [--count]
                           [--gateway-type {DistributedQuery, IntegratedCache}]
                           [--no-wait]
                           [--size]

示例

创建 cosmosdb 服务资源。

az cosmosdb service create --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway" --count 3 --size "Cosmos.D4s"

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--count -c

Instance Count.

属性
默认值: 1
--gateway-type

专用网关类型。 仅适用于 SqlDedicatedGateway 服务类型。

属性
默认值: IntegratedCache
接受的值: DistributedQuery, IntegratedCache
--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--size

Instance Size. 可能的值包括:Cosmos.D4s、Cosmos.D8s、Cosmos.D16s 等。

属性
默认值: Cosmos.D4s
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service create (cosmosdb-preview 扩展)

预览

命令组“cosmosdb 服务”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

创建 cosmosdb 服务资源。

az cosmosdb service create --account-name
                           --kind
                           --name
                           --resource-group-name
                           [--count]
                           [--gateway-type {DistributedQuery, IntegratedCache}]
                           [--no-wait]
                           [--size]

示例

创建 cosmosdb 服务资源。

az cosmosdb service create --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway" --kind "SqlDedicatedGateway" --count 3 --size "Cosmos.D4s"

创建 cosmosdb 具体化视图生成器服务资源。

az cosmosdb service create --resource-group MyResourceGroup --account-name MyAccount --name "MaterializedViewsBuilder" --kind "MaterializedViewsBuilder" --count 3 --size "Cosmos.D4s"

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--kind -k

Service kind.

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--count -c

Instance Count.

属性
默认值: 1
--gateway-type

专用网关类型。 仅适用于 SqlDedicatedGateway 服务类型。

属性
默认值: IntegratedCache
接受的值: DistributedQuery, IntegratedCache
--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--size

Instance Size. 可能的值包括:Cosmos.D4s、Cosmos.D8s、Cosmos.D16s 等。

属性
默认值: Cosmos.D4s
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service delete

删除给定的 cosmosdb 服务资源。

az cosmosdb service delete --account-name
                           --name
                           --resource-group-name
                           [--no-wait]
                           [--yes]

示例

删除给定的 cosmosdb 服务资源。

az cosmosdb service delete --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway"

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--yes -y

不要提示确认。

属性
默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service delete (cosmosdb-preview 扩展)

预览

命令组“cosmosdb 服务”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

删除给定的 cosmosdb 服务资源。

az cosmosdb service delete --account-name
                           --name
                           --resource-group-name
                           [--no-wait]
                           [--yes]

示例

删除给定的 cosmosdb 服务资源。

az cosmosdb service delete --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway"

删除 cosmosdb 具体化视图生成器服务资源。

az cosmosdb service delete --resource-group MyResourceGroup --account-name MyAccount --name "MaterializedViewsBuilder"

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--yes -y

不要提示确认。

属性
默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service list

列出帐户下的所有 cosmosdb 服务资源。

az cosmosdb service list --account-name
                         --resource-group-name

示例

列出帐户下的所有 cosmosdb 服务资源。

az cosmosdb service list --resource-group MyResourceGroup --account-name MyAccount

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--resource-group-name -g

数据库帐户的资源组的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service list (cosmosdb-preview 扩展)

预览

命令组“cosmosdb 服务”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

列出帐户下的所有 cosmosdb 服务资源。

az cosmosdb service list --account-name
                         --resource-group-name

示例

列出帐户下的所有 cosmosdb 服务资源。

az cosmosdb service list --resource-group MyResourceGroup --account-name MyAccount

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--resource-group-name -g

数据库帐户的资源组的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service show

在帐户下获取 cosmosdb 服务资源。

az cosmosdb service show --account-name
                         --name
                         --resource-group-name

示例

在帐户下获取 cosmosdb 服务资源。

az cosmosdb service show --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway"

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service show (cosmosdb-preview 扩展)

预览

命令组“cosmosdb 服务”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

在帐户下获取 cosmosdb 服务资源。

az cosmosdb service show --account-name
                         --name
                         --resource-group-name

示例

在帐户下获取 cosmosdb 服务资源。

az cosmosdb service show --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway"

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service update

更新 cosmosdb 服务资源。

az cosmosdb service update --account-name
                           --count
                           --name
                           --resource-group-name
                           [--no-wait]
                           [--size]

示例

更新 cosmosdb 服务资源。

az cosmosdb service update --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway" --count 3

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--count -c

Instance Count.

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--size

Instance Size. 可能的值包括:Cosmos.D4s、Cosmos.D8s、Cosmos.D16s 等。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az cosmosdb service update (cosmosdb-preview 扩展)

预览

命令组“cosmosdb 服务”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

更新 cosmosdb 服务资源。

az cosmosdb service update --account-name
                           --count
                           --kind
                           --name
                           --resource-group-name
                           [--no-wait]
                           [--size]

示例

更新 cosmosdb 服务资源。

az cosmosdb service update --resource-group MyResourceGroup --account-name MyAccount --name "sqlDedicatedGateway" --kind "SqlDedicatedGateway" --count 3

更新 cosmosdb 具体化视图生成器服务资源。

az cosmosdb service update --resource-group MyResourceGroup --account-name MyAccount --name "MaterializedViewsBuilder" --kind "MaterializedViewsBuilder" --count 3

必需参数

--account-name -a

Cosmos DB 数据库帐户的名称。

--count -c

Instance Count.

--kind -k

Service kind.

--name -n

Service Name.

--resource-group-name -g

数据库帐户的资源组的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--size

Instance Size. 可能的值包括:Cosmos.D4s、Cosmos.D8s、Cosmos.D16s 等。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False