如何在 Azure Cosmos DB 更改源中启用完全保真

问题描述

我正在尝试使用以下代码在 Change Feed 中启用完全保真:

ContainerProperties containerProperties = new ContainerProperties("myContainer","/pk");
containerProperties.ChangeFeedPolicy.FullFidelityRetention = TimeSpan.FromMinutes(5);

CosmosContainerResponse containerCreateResponse = await database.CreateContainerAsync(containerProperties,400);

但我得到以下异常:

The retention duration in Change Feed policy can only be enabled when Full-Fidelity is enabled for database account.

如何为数据库账户启用这种模式?我在门户网站上没有看到选项。

解决方法

公共预览版很快就会发布,您使用的是预览版 SDK,并且 API 已在那里启用,一旦公共预览版发布并且可以注册,用户就可以利用它们。敬请关注:)