gpt4 book ai didi

azure - 使用脚本重新创建 cosmos DB

转载 作者:行者123 更新时间:2023-12-02 07:08:12 26 4
gpt4 key购买 nike

我有一个与特定帐户绑定(bind)的现有 Cosmos DB。

我的问题是我是否可以使用脚本部署在另一个帐户中创建相同的 CosmosDB。

我已经研究过可以使用 Azure 资源管理器创建资源,但不确定如何获取现有 CosmosDB 的模板。

还有没有办法获取现有 CosmosDB 的 JSON 脚本?

最佳答案

您实际上并没有这样的架构,您有设置和索引配置以及其他 Assets 。

要迁移数据,请查看此工具

https://learn.microsoft.com/en-us/azure/cosmos-db/import-data

数据迁移后,只需复制并粘贴任何索引定义和其他 Assets (例如过程)即可。

您可能需要在迁移期间增加 RU。

有关如何使用该工具的一些示例:

将数据从一个 Azure Cosmos DB 集合迁移到另一个 Azure Cosmos DB 集合

dt.exe /s:CosmosDB /s.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /s.Collection:TEColl /t:CosmosDBBulk /t.ConnectionString:" AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /t.Collection:TESessions /t.CollectionThroughput:2500

将数据从多个 Azure Cosmos DB 集合迁移到单个 Azure Cosmos DB 集合

dt.exe /s:CosmosDB /s.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /s.Collection:comp1|comp2|comp3|comp4 /t:CosmosDBBulk /t.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /t.Collection:singleCollection /t.CollectionThroughput:2500

将 Azure Cosmos DB 集合导出到 JSON 文件

dt.exe /s:CosmosDB /s.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /s.Collection:StoresSub /t:JsonFile /t.File:StoresExport.json /t.Overwrite /t.CollectionThroughput:2500

关于azure - 使用脚本重新创建 cosmos DB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51141606/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com