Azure 使用脚本重新创建cosmos数据库

Azure 使用脚本重新创建cosmos数据库,azure,azure-cosmosdb,azure-powershell,azure-cli,Azure,Azure Cosmosdb,Azure Powershell,Azure Cli,我有一个现有的cosmos数据库绑定到一个特定的帐户 我的问题是,我是否可以使用脚本部署在另一个帐户中创建相同的CosmosDB 我已经调查了使用Azure资源管理器创建资源的可能性,但不确定如何获得现有CosmosDB的模板 还有一种方法可以获取现有CosmosDB的JSON脚本吗?您实际上没有这样的模式,您有设置和索引配置以及其他资产 要迁移数据,请查看此工具 迁移数据后,只需复制并粘贴任何索引、定义和其他资产(如过程) 您可能需要在迁移过程中提高RU 有关如何使用该工具的一些示例: 将数

我有一个现有的cosmos数据库绑定到一个特定的帐户

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

我已经调查了使用Azure资源管理器创建资源的可能性,但不确定如何获得现有CosmosDB的模板


还有一种方法可以获取现有CosmosDB的JSON脚本吗?

您实际上没有这样的模式,您有设置和索引配置以及其他资产

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

迁移数据后,只需复制并粘贴任何索引、定义和其他资产(如过程)

您可能需要在迁移过程中提高RU

有关如何使用该工具的一些示例: 将数据从一个Azure Cosmos DB集合迁移到另一个Azure Cosmos DB集合
dt.exe/s:CosmosDB/s.ConnectionString:“AccountEndpoint=;AccountKey=;Database=;”/s.Collection:TEColl/t:CosmosDBBulk/t.ConnectionString:“AccountEndpoint=;AccountKey=;Database=;”/t.Collection:TESessions/t.Collection吞吐量:2500
将数据从多个Azure Cosmos DB集合迁移到单个Azure Cosmos DB集合
dt.exe/s:CosmosDB/s.ConnectionString:“AccountEndpoint=;AccountKey=;Database=;”/s.Collection:comp1 | comp2 | comp3 | comp4/t:CosmosDBBulk/t.ConnectionString:“AccountEndpoint=;AccountKey=;Database=”/t.Collection:singleCollection/t.Collection吞吐量:2500
将Azure Cosmos DB集合导出到JSON文件
dt.exe/s:CosmosDB/s.ConnectionString:“AccountEndpoint=;AccountKey=;Database=;”/s.Collection:StoresSub/t:JsonFile/t.File:StoresExport.json/t.Overwrite/t.Collection吞吐量:2500
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
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
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