如何使用带有分区键的 CosmosDb 作为流分析输出?
How to use CosmosDb with partition key as a Stream Analytics output?
我正在使用分区键设置 CosmosDb 作为流分析作业输出,但连接测试失败并出现以下错误:
Error connecting to Cosmos DB Database: Invalid or no matching collections >found with collection pattern 'containername/{partition}'. Collections must >exist with case-sensitive pattern in increasing numeric order starting with >0..
注意:我将 cosmosdb 与 SQL API 一起使用,但配置是通过 portal.azure.com
完成的
我已确认我可以通过门户数据资源管理器将文档手动插入到 DocumentDB 中。这些插入成功并且分区键值被正确识别。
我是这样设置 Cosmos 容器的
Database Id: testdb
Container id: containername
Partition key: /partitionkey
Throughput: 1000
我这样设置流分析输出
Output Alias: test-output-db
Subscription: My-Subscription-Name
Account id: MyAccountId
Database -> Use Existing: testdb
Collection name pattern: containername/{partition}
Partition Key: partitionkey
Document id:
在测试输出连接时出现故障并出现上面列出的错误。
我收到 Microsoft 支持部门的回复,称 Azure 流分析不再支持通过“{partition}”令牌模式指定分区。此外,从 ASA 写入多个容器通常已被弃用。现在,如果 ASA 输出到配置了分区的 CosmosDb,Cosmos 应该会自动处理它。
after discussion with our ASA developer/product group team, the
collection pattern such as MyCollection{partition} or
MyCollection/{partition} is no longer supported. Writing to multiple
fixed containers is being deprecated and it is not the recommended
approach for scaling out the Stream Analytics job [...] In summary,
you can define the collection name simply as "apitraffic". You don't
need to specify any partition key as we detect it automatically from
Cosmos DB.
我正在使用分区键设置 CosmosDb 作为流分析作业输出,但连接测试失败并出现以下错误:
Error connecting to Cosmos DB Database: Invalid or no matching collections >found with collection pattern 'containername/{partition}'. Collections must >exist with case-sensitive pattern in increasing numeric order starting with >0..
注意:我将 cosmosdb 与 SQL API 一起使用,但配置是通过 portal.azure.com
完成的我已确认我可以通过门户数据资源管理器将文档手动插入到 DocumentDB 中。这些插入成功并且分区键值被正确识别。
我是这样设置 Cosmos 容器的
Database Id: testdb
Container id: containername
Partition key: /partitionkey
Throughput: 1000
我这样设置流分析输出
Output Alias: test-output-db
Subscription: My-Subscription-Name
Account id: MyAccountId
Database -> Use Existing: testdb
Collection name pattern: containername/{partition}
Partition Key: partitionkey
Document id:
在测试输出连接时出现故障并出现上面列出的错误。
我收到 Microsoft 支持部门的回复,称 Azure 流分析不再支持通过“{partition}”令牌模式指定分区。此外,从 ASA 写入多个容器通常已被弃用。现在,如果 ASA 输出到配置了分区的 CosmosDb,Cosmos 应该会自动处理它。
after discussion with our ASA developer/product group team, the collection pattern such as MyCollection{partition} or MyCollection/{partition} is no longer supported. Writing to multiple fixed containers is being deprecated and it is not the recommended approach for scaling out the Stream Analytics job [...] In summary, you can define the collection name simply as "apitraffic". You don't need to specify any partition key as we detect it automatically from Cosmos DB.