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

如何停止Azure Cosmos DB(MongoDB兼容版)?测试站点需停库却无对应选项

How to "Pause" Azure Cosmos DB (MongoDB API) for Debugging (No Stop Option Available)

Hey there! I totally get the frustration—you’re trying to debug your Azure-hosted site by isolating process behavior, and you want to stop your Cosmos DB (MongoDB API) instance, but can’t find a straightforward "stop" button. That’s actually by design: Cosmos DB is a fully managed, always-on cloud database built for high availability, so there’s no native way to shut it down completely. But don’t worry, we’ve got workarounds to simulate that "stopped" state for your debugging needs:

  • Scale throughput to the absolute minimum
    The closest you can get to idling the database is cranking down its provisioned throughput (RU/s) to the lowest possible value. For MongoDB API, that’s 400 RU/s (the minimum for provisioned mode). This drastically reduces resource usage and makes the database effectively unresponsive to meaningful traffic. Here’s how to do it:

    1. Open your Cosmos DB resource in the Azure Portal
    2. Head to the Data Explorer tab
    3. Select your target database or individual container
    4. Go to Scale & Settings
    5. Adjust the throughput slider to 400 RU/s and save the changes
  • Block all network access temporarily
    If you need the database to be completely unreachable by your site’s processes, you can cut off its network access entirely. This acts just like stopping the database, since your app won’t be able to connect at all. Here’s the steps:

    1. In your Cosmos DB resource, navigate to Firewall and virtual networks under Settings
    2. Under "Allow access from", switch from All networks to Selected networks
    3. Remove any existing IP ranges or virtual networks that have access permissions
    4. Save the configuration—your app will now get connection errors, just like if the database was stopped
  • Apply a read-only lock (for write-blocking scenarios)
    If you don’t need to stop the database entirely, just prevent any write operations (to isolate read vs write process behavior), a read-only resource lock works perfectly. This won’t halt the database, but it will block all modifications and config changes:

    1. Go to your Cosmos DB resource in the Azure Portal
    2. Click on Locks under the Settings section
    3. Hit Add, choose Read-only as the lock type, give it a name, and save

Just make sure to revert these changes once you’re done debugging—you don’t want to leave your database under-provisioned or locked down accidentally!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 03:20:59