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

az documentdb mongocluster

注释

此引用是 Azure CLI (版本 2.75.0 或更高版本)的 documentdb 扩展的一部分。 该扩展将在首次运行 az documentdb mongocluster 命令时自动安装。 了解更多关于扩展程序的信息。

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

管理 Azure DocumentDB mongo 群集。

命令

名称 说明 类型 Status
az documentdb mongocluster check-name-availability

检查 Mongo 群集名称是否可用。

扩展 Preview
az documentdb mongocluster create

创建 mongo 群集。 更新将覆盖资源的所有属性。 若要仅修改某些属性,请使用 PATCH。

扩展 Preview
az documentdb mongocluster delete

删除 mongo 群集。

扩展 Preview
az documentdb mongocluster firewall-rule

管理防火墙规则。

扩展 Preview
az documentdb mongocluster firewall-rule create

创建新的防火墙规则或更新 Mongo 群集上的现有防火墙规则。

扩展 Preview
az documentdb mongocluster firewall-rule delete

删除 Mongo 群集防火墙规则。

扩展 Preview
az documentdb mongocluster firewall-rule list

列出给定 mongo 群集中的所有防火墙规则。

扩展 Preview
az documentdb mongocluster firewall-rule show

获取有关 mongo 群集防火墙规则的信息。

扩展 Preview
az documentdb mongocluster firewall-rule update

更新新的防火墙规则或更新 Mongo 群集上的现有防火墙规则。

扩展 Preview
az documentdb mongocluster firewall-rule wait

将 CLI 置于等待状态,直到满足条件。

扩展 Preview
az documentdb mongocluster identity

管理标识。

扩展 Preview
az documentdb mongocluster identity assign

分配用户或系统托管标识。

扩展 Preview
az documentdb mongocluster identity list

列出分配给 Mongo 群集的托管标识。

扩展 Preview
az documentdb mongocluster identity remove

删除用户或系统托管标识。

扩展 Preview
az documentdb mongocluster identity show

显示托管标识的详细信息。

扩展 Preview
az documentdb mongocluster identity wait

将 CLI 置于等待状态,直到满足条件。

扩展 Preview
az documentdb mongocluster list

列出给定订阅中的所有 mongo 群集。

扩展 Preview
az documentdb mongocluster list-connection-strings

列出 mongo 群集连接字符串。 这包括使用 SCRAM-SHA-256 的默认连接字符串,以及群集支持的其他连接字符串。

扩展 Preview
az documentdb mongocluster microsoft-entra-user

管理 mongo 群集上的Microsoft Entra ID用户。

扩展 Preview
az documentdb mongocluster microsoft-entra-user assign

通过为其分配数据库角色,授予对 mongo 群集Microsoft Entra ID主体访问权限。

扩展 Preview
az documentdb mongocluster microsoft-entra-user list

列出 mongo 群集上的Microsoft Entra ID用户。

扩展 Preview
az documentdb mongocluster microsoft-entra-user remove

从 mongo 群集中删除Microsoft Entra ID主体的访问权限。

扩展 Preview
az documentdb mongocluster microsoft-entra-user show

获取 mongo 群集上Microsoft Entra ID用户的定义。

扩展 Preview
az documentdb mongocluster microsoft-entra-user wait

将 CLI 置于等待状态,直到满足条件。

扩展 Preview
az documentdb mongocluster replica

管理副本。

扩展 Preview
az documentdb mongocluster replica create

创建现有 Mongo 群集的只读副本。

扩展 Preview
az documentdb mongocluster replica list

列出 Mongo 群集的所有副本。

扩展 Preview
az documentdb mongocluster replica promote

将副本 mongo 群集提升为主要角色。

扩展 Preview
az documentdb mongocluster reset-password

重置 Mongo 群集的管理员密码。

扩展 Preview
az documentdb mongocluster restore

从某个时间点将 Mongo 群集还原到新群集。

扩展 Preview
az documentdb mongocluster show

获取有关 mongo 群集的信息。

扩展 Preview
az documentdb mongocluster update

更新 mongo 群集。 仅修改请求中指定的属性;所有其他属性保持不变(HTTP PATCH)。 支持泛型更新参数(--set、--add、--remove)。

扩展 Preview
az documentdb mongocluster wait

将 CLI 置于等待状态,直到满足条件。

扩展 Preview

az documentdb mongocluster check-name-availability

预览

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

检查 Mongo 群集名称是否可用。

az documentdb mongocluster check-name-availability [--acquire-policy-token]
                                                   [--change-reference]
                                                   [--ids]
                                                   [--location]
                                                   [--name]
                                                   [--subscription]
                                                   [--type]

示例

检查 Mongo 群集名称是否可用。

az documentdb mongocluster check-name-availability --location eastus --name MyCluster

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--location -l

Location. az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

属性 值
参数组: Resource Id Arguments
--name

需要检查其可用性的资源的名称。

属性 值
参数组: Body Arguments
--subscription

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

属性 值
参数组: Resource Id Arguments
--type

资源类型。

属性 值
参数组: Body Arguments
默认值: Microsoft.DocumentDB/mongoClusters
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False

az documentdb mongocluster create

预览

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

创建 mongo 群集。 更新将覆盖资源的所有属性。 若要仅修改某些属性,请使用 PATCH。

az documentdb mongocluster create --admin-password --password
                                  --admin-user
                                  --cluster-name --name
                                  --high-availability {Disabled, SameZone, ZoneRedundantPreferred}
                                  --resource-group
                                  --shard-count
                                  --storage-size
                                  --tier
                                  [--acquire-policy-token]
                                  [--auth-allowed-modes]
                                  [--change-reference]
                                  [--data-api-mode {Disabled, Enabled}]
                                  [--encryption]
                                  [--location]
                                  [--mi-user-assigned --user-assigned]
                                  [--network-bypass-mode {AzureCosmosDB, None}]
                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--preview-features]
                                  [--public-network-access {Disabled, Enabled}]
                                  [--server-version]
                                  [--storage-type {PremiumSSD, PremiumSSDv2}]
                                  [--tags]

示例

使用高级 SSD v2 存储创建 Mongo 群集。

az documentdb mongocluster create -n MyCluster -g MyResourceGroup --location eastus --admin-user dbadmin --admin-password MyP@ssw0rd123! --tier M30 --storage-size 128 --storage-type PremiumSSDv2 --shard-count 1 --high-availability Disabled

必需参数

--admin-password --password -p

管理员密码。 如果值为空,则从 tty 中询问该值。

属性 值
参数组: Administrator Arguments
--admin-user -u

管理员用户名。

属性 值
参数组: Administrator Arguments
--cluster-name --name -n

mongo 群集的名称。

--high-availability

为群集请求的目标高可用性模式。

属性 值
参数组: HighAvailability Arguments
接受的值: Disabled, SameZone, ZoneRedundantPreferred
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--shard-count

在群集上预配的分片数。

属性 值
参数组: Sharding Arguments
--storage-size

分配给每个服务器的数据磁盘的大小。

属性 值
参数组: Storage Arguments
--tier

要分配给群集的计算层,其中每个层映射到虚拟核心和内存大小。 示例值:“M30”、“M40”。

属性 值
参数组: Compute Arguments

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--auth-allowed-modes

用于数据访问的允许身份验证模式的空间分隔列表。 允许的值:NativeAuth、MicrosoftEntraID。 示例:--auth-allowed-modes NativeAuth MicrosoftEntraID 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: AuthConfig Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--data-api-mode

启用或禁用群集上的 Mongo 数据 API。 允许的值:“Enabled”、“Disabled”。 示例:已启用 --data-api-mode。

属性 值
参数组: DataApi Arguments
接受的值: Disabled, Enabled
--encryption

集群的加密配置。 取决于正在配置的标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Properties Arguments
--location -l

未指定资源所在的地理位置,将使用资源组的位置。

属性 值
参数组: Resource Arguments
--mi-user-assigned --user-assigned

设置用户托管标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Identity Arguments
--network-bypass-mode

集群的网络绕过模式。 设置为“AzureCosmosDB”可以让 Azure Cosmos DB 服务绕过网络限制。

属性 值
参数组: Properties Arguments
接受的值: AzureCosmosDB, None
--no-wait

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

属性 值
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--preview-features

在群集上启用的预览功能的空间分隔列表。 预览功能名称为自由格式字符串;请参阅 Mongo 群集功能文档,了解当前可用的值。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Properties Arguments
--public-network-access

是否允许此 mongo 群集访问公共终结点。

属性 值
参数组: Properties Arguments
接受的值: Disabled, Enabled
--server-version

Mongo DB 服务器版本。 如果未指定,则默认为最新可用版本。

属性 值
参数组: Properties Arguments
--storage-type

用于预置集群服务器的存储类型。

属性 值
参数组: Storage Arguments
接受的值: PremiumSSD, PremiumSSDv2
--tags

资源标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Resource Arguments
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

属性 值
默认值: 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 documentdb mongocluster delete

预览

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

删除 mongo 群集。

az documentdb mongocluster delete [--acquire-policy-token]
                                  [--change-reference]
                                  [--cluster-name --name]
                                  [--ids]
                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--resource-group]
                                  [--subscription]
                                  [--yes]

示例

删除 mongo 群集。

az documentdb mongocluster delete -n MyCluster -g MyResourceGroup

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--cluster-name --name -n

mongo 群集的名称。

属性 值
参数组: Resource Id Arguments
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--no-wait

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

属性 值
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

属性 值
参数组: Resource Id Arguments
--subscription

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

属性 值
参数组: Resource Id Arguments
--yes -y

不请求确认。

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

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False

az documentdb mongocluster list

预览

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

列出给定订阅中的所有 mongo 群集。

az documentdb mongocluster list [--max-items]
                                [--next-token]
                                [--resource-group]

示例

列出资源组中的所有 mongo 群集。

az documentdb mongocluster list -g MyResourceGroup

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--max-items

命令输出中要返回的项总数。 如果可用的项总数大于指定的值,则会在命令的输出中提供令牌。 若要恢复分页,请在后续命令的 --next-token 参数中提供令牌值。

属性 值
参数组: Pagination Arguments
--next-token

用于指定开始分页的位置的令牌。 这是先前截断的响应中的令牌值。

属性 值
参数组: Pagination Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

属性 值
默认值: 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 documentdb mongocluster list-connection-strings

预览

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

列出 mongo 群集连接字符串。 这包括使用 SCRAM-SHA-256 的默认连接字符串,以及群集支持的其他连接字符串。

az documentdb mongocluster list-connection-strings [--acquire-policy-token]
                                                   [--change-reference]
                                                   [--cluster-name]
                                                   [--ids]
                                                   [--resource-group]
                                                   [--subscription]

示例

列出 Mongo 群集的连接字符串。

az documentdb mongocluster list-connection-strings --cluster-name MyCluster -g MyResourceGroup

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--cluster-name

mongo 群集的名称。

属性 值
参数组: Resource Id Arguments
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

属性 值
参数组: Resource Id Arguments
--subscription

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

属性 值
参数组: Resource Id Arguments
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False

az documentdb mongocluster reset-password

预览

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

重置 Mongo 群集的管理员密码。

az documentdb mongocluster reset-password --admin-password --password
                                          [--acquire-policy-token]
                                          [--change-reference]
                                          [--cluster-name --name]
                                          [--ids]
                                          [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                          [--resource-group]
                                          [--subscription]

示例

重置管理员密码。

az documentdb mongocluster reset-password -n MyCluster -g MyResourceGroup --admin-password NewP@ssw0rd123!

必需参数

--admin-password --password -p

新的管理员密码。 如果值为空,则从 tty 中询问该值。

属性 值
参数组: Administrator Arguments

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--cluster-name --name -n

mongo 群集的名称。

属性 值
参数组: Resource Id Arguments
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--no-wait

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

属性 值
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

属性 值
参数组: Resource Id Arguments
--subscription

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

属性 值
参数组: Resource Id Arguments
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False

az documentdb mongocluster restore

预览

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

从某个时间点将 Mongo 群集还原到新群集。

在请求的时间点从现有(或删除)源群集的备份创建新的 mongo 群集。 支持的目标配置选项包括本机身份验证、客户管理的密钥加密、用户分配的托管标识、存储类型、公用网络访问和资源标记。 此命令不支持服务器版本、计算层、存储大小、分片计数、高可用性、数据 API、网络绕过和预览功能替代。 配置Microsoft Entra ID身份验证并在还原完成后分配用户,使还原权限与数据访问授权分开。

az documentdb mongocluster restore --cluster-name --name
                                   --resource-group
                                   --restore-time
                                   --source-cluster
                                   [--acquire-policy-token]
                                   [--admin-password --password]
                                   [--admin-user]
                                   [--auth-allowed-modes]
                                   [--change-reference]
                                   [--encryption]
                                   [--location]
                                   [--mi-user-assigned --user-assigned]
                                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                   [--public-network-access {Disabled, Enabled}]
                                   [--storage-type {PremiumSSD, PremiumSSDv2}]
                                   [--tags]

示例

使用本机身份验证还原群集。

az documentdb mongocluster restore -n RestoredCluster -g MyResourceGroup --location eastus2 --source-cluster MySourceCluster --restore-time "2026-06-30T10:00:00Z" --admin-user dbadmin --admin-password MyP@ssw0rd123!

使用存储类型和公用网络访问设置还原群集。

az documentdb mongocluster restore -n RestoredCluster -g MyResourceGroup --location eastus2 --source-cluster MySourceCluster --restore-time "2026-06-30T10:00:00Z" --admin-user dbadmin --admin-password MyP@ssw0rd123! --storage-type PremiumSSDv2 --public-network-access Disabled

使用资源标记还原群集。

az documentdb mongocluster restore -n RestoredCluster -g MyResourceGroup --location eastus2 --source-cluster MySourceCluster --restore-time "2026-06-30T10:00:00Z" --admin-user dbadmin --admin-password MyP@ssw0rd123! --tags environment=restored team=documentdb

必需参数

--cluster-name --name -n

mongo 群集的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--restore-time

要从中还原的 UTC 时间点,采用 ISO-8601 格式(例如:2026-06-30T10:00:00Z)。

属性 值
参数组: Restore Arguments
--source-cluster

要从中还原的源 mongo 群集的名称或资源 ID。 如果指定了名称,则假定当前订阅和资源组。

属性 值
参数组: Restore Arguments

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--admin-password --password -p

管理员密码。 NativeAuth 是必需的,包括使用 NativeAuth 的 CMK 还原。 如果值为空,则从 tty 中询问该值。

属性 值
参数组: Administrator Arguments
--admin-user -u

管理员用户名。 NativeAuth 是必需的,包括使用 NativeAuth 的 CMK 还原。

属性 值
参数组: Administrator Arguments
--auth-allowed-modes

已还原群集的身份验证模式。 仅支持 NativeAuth。 配置Microsoft Entra ID身份验证并在还原后分配用户。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: AuthConfig Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--encryption

集群的加密配置。 取决于正在配置的标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Properties Arguments
--location -l

未指定资源所在的地理位置,将使用资源组的位置。

属性 值
参数组: Resource Arguments
--mi-user-assigned --user-assigned

设置用户托管标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Identity Arguments
--no-wait

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

属性 值
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--public-network-access

已还原群集的公用网络访问设置。

属性 值
参数组: Properties Arguments
接受的值: Disabled, Enabled
--storage-type

已还原群集的存储类型。

属性 值
参数组: Storage Arguments
接受的值: PremiumSSD, PremiumSSDv2
--tags

已还原群集的资源标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Resource Arguments
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

属性 值
默认值: 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 documentdb mongocluster show

预览

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

获取有关 mongo 群集的信息。

az documentdb mongocluster show [--cluster-name --name]
                                [--ids]
                                [--resource-group]
                                [--subscription]

示例

获取有关 mongo 群集的信息。

az documentdb mongocluster show -n MyCluster -g MyResourceGroup

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--cluster-name --name -n

mongo 群集的名称。

属性 值
参数组: Resource Id Arguments
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

属性 值
参数组: Resource Id Arguments
--subscription

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

属性 值
参数组: Resource Id Arguments
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False

az documentdb mongocluster update

预览

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

更新 mongo 群集。 仅修改请求中指定的属性;所有其他属性保持不变(HTTP PATCH)。 支持泛型更新参数(--set、--add、--remove)。

az documentdb mongocluster update [--acquire-policy-token]
                                  [--add]
                                  [--admin-password --password]
                                  [--admin-user]
                                  [--auth-allowed-modes]
                                  [--change-reference]
                                  [--cluster-name --name]
                                  [--data-api-mode {Disabled, Enabled}]
                                  [--encryption]
                                  [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--high-availability {Disabled, SameZone, ZoneRedundantPreferred}]
                                  [--ids]
                                  [--network-bypass-mode {AzureCosmosDB, None}]
                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--preview-features]
                                  [--public-network-access {Disabled, Enabled}]
                                  [--remove]
                                  [--resource-group]
                                  [--server-version]
                                  [--set]
                                  [--shard-count]
                                  [--storage-size]
                                  [--storage-type {PremiumSSD, PremiumSSDv2}]
                                  [--subscription]
                                  [--tags]
                                  [--tier]

示例

更新 mongo 群集的计算层。

az documentdb mongocluster update -n MyCluster -g MyResourceGroup --tier M40

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>。

属性 值
参数组: Generic Update Arguments
--admin-password --password -p

管理员密码。 如果值为空,则从 tty 中询问该值。

属性 值
参数组: Administrator Arguments
--admin-user -u

管理员用户名。

属性 值
参数组: Administrator Arguments
--auth-allowed-modes

用于数据访问的允许身份验证模式的空间分隔列表。 允许的值:NativeAuth、MicrosoftEntraID。 示例:--auth-allowed-modes NativeAuth MicrosoftEntraID 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: AuthConfig Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--cluster-name --name -n

mongo 群集的名称。

属性 值
参数组: Resource Id Arguments
--data-api-mode

启用或禁用群集上的 Mongo 数据 API。 允许的值:“Enabled”、“Disabled”。 示例:已启用 --data-api-mode。

属性 值
参数组: DataApi Arguments
接受的值: Disabled, Enabled
--encryption

集群的加密配置。 取决于正在配置的标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Properties Arguments
--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

属性 值
参数组: Generic Update Arguments
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--high-availability

为群集请求的目标高可用性模式。

属性 值
参数组: HighAvailability Arguments
接受的值: Disabled, SameZone, ZoneRedundantPreferred
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--network-bypass-mode

集群的网络绕过模式。 设置为“AzureCosmosDB”可以让 Azure Cosmos DB 服务绕过网络限制。

属性 值
参数组: Properties Arguments
接受的值: AzureCosmosDB, None
--no-wait

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

属性 值
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--preview-features

在群集上启用的预览功能的空间分隔列表。 预览功能名称为自由格式字符串;请参阅 Mongo 群集功能文档,了解当前可用的值。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Properties Arguments
--public-network-access

是否允许此 mongo 群集访问公共终结点。

属性 值
参数组: Properties Arguments
接受的值: Disabled, Enabled
--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

属性 值
参数组: Generic Update Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

属性 值
参数组: Resource Id Arguments
--server-version

Mongo DB 服务器版本。 如果未指定,则默认为最新可用版本。

属性 值
参数组: Properties Arguments
--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>。

属性 值
参数组: Generic Update Arguments
--shard-count

在群集上预配的分片数。

属性 值
参数组: Sharding Arguments
--storage-size

分配给每个服务器的数据磁盘的大小。

属性 值
参数组: Storage Arguments
--storage-type

用于预置集群服务器的存储类型。

属性 值
参数组: Storage Arguments
接受的值: PremiumSSD, PremiumSSDv2
--subscription

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

属性 值
参数组: Resource Id Arguments
--tags

资源标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性 值
参数组: Resource Arguments
--tier

要分配给群集的计算层,其中每个层映射到虚拟核心和内存大小。 示例值:“M30”、“M40”。

属性 值
参数组: Compute Arguments
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False

az documentdb mongocluster wait

预览

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

将 CLI 置于等待状态,直到满足条件。

az documentdb mongocluster wait [--acquire-policy-token]
                                [--change-reference]
                                [--cluster-name --name]
                                [--created]
                                [--custom]
                                [--deleted]
                                [--exists]
                                [--ids]
                                [--interval]
                                [--resource-group]
                                [--subscription]
                                [--timeout]
                                [--updated]

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性 值
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性 值
参数组: Global Policy Arguments
--cluster-name --name -n

mongo 群集的名称。

属性 值
参数组: Resource Id Arguments
--created

等待在“Succeeded”中使用“provisioningState”创建。

属性 值
参数组: Wait Condition Arguments
默认值: False
--custom

等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

属性 值
参数组: Wait Condition Arguments
--deleted

等到删除为止。

属性 值
参数组: Wait Condition Arguments
默认值: False
--exists

等待资源存在。

属性 值
参数组: Wait Condition Arguments
默认值: False
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性 值
参数组: Resource Id Arguments
--interval

轮询间隔(以秒为单位)。

属性 值
参数组: Wait Condition Arguments
默认值: 30
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

属性 值
参数组: Resource Id Arguments
--subscription

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

属性 值
参数组: Resource Id Arguments
--timeout

最大等待(以秒为单位)。

属性 值
参数组: Wait Condition Arguments
默认值: 3600
--updated

等到 provisioningState 更新为“Succeeded”。

属性 值
参数组: Wait Condition Arguments
默认值: False
全局参数
--debug

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

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

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

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

输出格式。

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

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

--verbose

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

属性 值
默认值: False