[bcp使用ActiveDirectoryPassword身份验证登录失败

问题描述 投票:0回答:1

遵循以下链接中的描述:

https://docs.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-ver15#G

目标-使用BCP实用程序,尝试使用Azure Active Directory用户名和密码登录到SQL Server。

在以下命令中使用:

[bcp tableName输出“ C:\ temp \ tabledata.txt” -c -t -S xxxxxxx.database.windows.net -d AzureDB -G -U [email protected] -P xxxxx

得到以下错误:

SQLState = FA004,NativeError = 0错误= [Microsoft] [用于SQL Server的ODBC驱动程序17] [SQL Server]无法在Active Directory中对用户“ [email protected]”进行身份验证(身份验证选项为“ ActiveDirectoryPassword”)。错误代码0x800401F0;状态10尚未调用CoInitialize。

有帮助吗?

azure azure-active-directory bcp
1个回答
0
投票

我想您没有设置公共IP地址和活动目录来访问您的Azure SQL服务器。并且请确保您的用户名和密码正确。

如果不进行配置,将会遇到此错误:

enter image description here

配置步骤:

  1. 允许您的公共IP地址:

enter image description here

2。允许您使用AAD身份验证。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.