[英]How to resolve Azure “Windows logins are not supported in this version of SQL Server”?
[英]Error in creating a linked server to SQL Azure database from a SQL Express instance “Windows logins are not supported in this version of SQL Server.”
我正在嘗試在虛擬機上使用 SQL Express 2019 將鏈接服務器設置到 Azure 數據倉庫。 我已經使用 sql 登錄成功創建了鏈接服務器,但 AAD 登錄不起作用。
我正在使用以下字符串
Server=tcp:sqldw.windows.net,1433;Initial Catalog=sqldb;Persist Security Info=False;;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated";
這是錯誤:
此版本的 SQL Server 不支持 Windows 登錄。 (.Net SqlClient 數據提供程序)
如果您是 EF Core,則使用 v3.0 而不是System.Data.SqlClient ,從 V3.0 開始。 請擁有目前最新的Microsoft.Data.SqlClient版本(包括預覽版本)僅支持這兩個 NET Framework 選擇。”
注意:NetCore 程序當前不支持ActiveDirectoryIntegrated
或ActiveDirectoryInteractive
身份驗證選項。
Active Directory Integrated 無法在 .NET Core 3.1 中運行,但在安裝 NuGet 包 Microsoft.Data.SqlClient// 版本 v2.0.1 后,它現在可以運行了。 它現在使用以下連接字符串:
"ipsdbconnstr": "Server=tcp:ipsdbserver.database.windows.net,1433;Database=MyDb;Authentication=ActiveDirectoryIntegrated"
使用附加屬性,示例如下:
;用戶 ID=userid@mydomain.com;Persist Security Info=true;Encrypt=true;TrustServerCertificate=true;MultipleActiveResultSets=true
當TrustServerCertificate
設置為 false 並且 Encrypt 設置為 true 時,SQL Server SSL 證書上的服務器名稱(或 IP 地址)必須與連接字符串中給出的服務器(或 IP 地址)名稱完全匹配。
否則,連接的努力將被侵犯。 換句話說,執行的唯一安全檢查是“ encrypt=true
; trustservercertificate=false
”的組合,用於驗證主機名證書是否與您要連接的服務器主機名匹配。
trustservercertificate=false
將不接受自動簽名的證書,因此仍然需要使用已知/可信賴的 CA 對證書進行簽名。
設置TrustServerCertificate=true
以解決問題。
您應該使用來自聯合域或配置為無縫單點登錄的托管域的 Azure Active Directory 憑據登錄 Windows,以進行直通和密碼哈希身份驗證。
供您參考的文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.