You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Az Cli恢复CosmosDb时强制设置最低TLS1.2版本?

解决Cosmos DB恢复后强制设置最低TLS 1.2版本的问题

目前az cosmosdb restore命令暂不支持直接指定恢复后账户的最低TLS版本,你可以通过两步操作实现需求:

  1. 执行你的恢复命令完成账户恢复
az cosmosdb restore --target-database-account-name "<target-db-account-name>" --account-name "<account-name>" --restore-timestamp 2024-05-28T15:06:00+0000 --resource-group "<rgName>" --location "<location>" --public-network-access Disabled --disable-ttl True
  1. 恢复完成后,立即使用az cosmosdb update命令强制设置最低TLS版本为1.2
az cosmosdb update --name "<target-db-account-name>" --resource-group "<rgName>" --min-tls-version "1.2"

补充说明

  • 该操作会将目标账户的最低TLS版本直接更新为1.2,符合你的策略要求
  • 若需要自动化执行,可将两个命令按顺序写入脚本(如Bash/PowerShell),确保恢复完成后自动触发TLS版本更新

内容的提问来源于stack exchange,提问作者Kiru

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 09:22:48