在 Azure Cosmos DB 中优化开发和测试成本Optimize development and testing cost in Azure Cosmos DB

本文介绍免费使用 Azure Cosmos DB 进行开发和测试的不同选项。This article describes the different options to use Azure Cosmos DB for development and testing for free of cost.

Azure Cosmos DB 模拟器(可以本地下载的版本)Azure Cosmos DB emulator (locally downloadable version)

Azure Cosmos DB 模拟器是一个本地的可下载版本,模拟 Azure Cosmos DB 云服务。Azure Cosmos DB emulator is a local downloadable version that mimics the Azure Cosmos DB cloud service. 即使没有网络连接,也可以编写并测试使用 Azure Cosmos DB API 的代码,不需支付任何费用。You can write and test code that uses the Azure Cosmos DB APIs even if you have no network connection and without incurring any costs. Azure Cosmos DB 模拟器提供了一个用于开发的具有云服务高保真特性的本地环境。Azure Cosmos DB emulator provides a local environment for development purposes with high fidelity to the cloud service. 可以在本地开发和测试应用程序,无需创建 Azure 订阅。You can develop and test your application locally, without creating an Azure subscription. 做好将应用程序部署到云的准备以后,即可更新连接到云中的 Azure Cosmos DB 终结点所需的连接字符串,不需进行其他的修改。When you're ready to deploy your application to the cloud, update the connection string to connect to the Azure Cosmos DB endpoint in the cloud, no other modifications are needed. 也可在 Azure DevOps 中通过 Azure Cosmos DB 模拟器生成任务设置 CI/CD 管道,以便运行测试。You can also set up a CI/CD pipeline with the Azure Cosmos DB emulator build task in Azure DevOps to run tests. 若要开始操作,可以参阅 Azure Cosmos DB 模拟器一文。You can get started by visiting the Azure Cosmos DB emulator article.

Azure 免费帐户Azure Free Account

Azure Cosmos DB 包含在 Azure 试用帐户中,该帐户提供 Azure 信用额度和资源,可以免费使用特定的一段时间。Azure Cosmos DB is included in the Azure trial account, which offers Azure credits and resources for free for a certain time period. 特别对于 Azure Cosmos DB,该试用帐户提供 5 GB 的存储和 400 RU 的全年预配吞吐量。Specifically for Azure Cosmos DB, this trial account offers 5-GB storage and 400 RUs of provisioned throughput for the entire year. 任何开发人员都可以通过此体验轻松地测试 Azure Cosmos DB 的功能,或者将其与其他 Azure 服务集成,没有任何费用。This experience enables any developer to easily test the features of Azure Cosmos DB or integrate it with other Azure services at zero cost. Azure 试用帐户提供 $200 的信用额度,可以在头 30 天使用。With Azure trial account, you get a $200 credit to spend in the first 30 days. 在选择升级之前,即使开始使用服务也不会收费。You won't be charged, even if you start using the services until you choose to upgrade. 若要开始操作,请访问 Azure 试用帐户页。To get started, visit Azure trial account page.

后续步骤Next steps

可以按照以下文章的说明,开始使用模拟器或免费的 Azure Cosmos DB 帐户:You can get started with using the emulator or the free Azure Cosmos DB accounts with the following articles: