使用 Azure DocumentDB 的 Azure AD 应用程序

Azure AD application using Azure DocumentDB

我需要使用 DocumentDB 创建 Azure AD 应用程序。我们需要在将存储用户缓存信息的 AD 应用程序中提供数据库服务器的连接字符串。

当我尝试用 DocumentDB 连接字符串替换 SQL Azure 连接字符串时,出现错误:

"application's configuration file does not contain the required providerName attribute.".

您不能简单地交换连接字符串并期望您的应用程序开始使用 DocumentDB 而不是 SQL Server。在您的应用程序中,您可能正在使用 Entity Framework 库、ADO.NET 或其他专门查找 SQL 服务器连接字符串的库。此外,您的代码依赖于这些库。

要从 SQL 服务器切换到 DocumentDB,您需要引入 DocumentDB 客户端库。然后,根据需要重构代码以使用新库。

使用 DocumentDB 的简单 ASP.NET MVC 应用程序示例可用 here