使用用户管理的标识将 C# Azure Function 与 Azure SQL 连接。认证失败
使用用户管理的标识将 C# Azure Function 与 Azure SQL 连接。认证失败
通常,连接字符串会根据身份验证类型的不同而有所不同,其中用户 ID 和身份验证值也会有所不同。
正如@Scott Mildenberger建议,MS Doc指出在指定应用程序配置设置时在数据库服务器的连接字符串中添加属性
User Id=ClientIdOfManagedIdentity
。
在您的情况下,
Authentication
和UserId
值设置为Active Directory Managed Identity
和ClientIdOfManagedIdentity
,然后必须部署它以反映更改和工作。