bcp Login failed using ActiveDirectoryPassword authentication

0

Followed the description mentioned in below link:

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

Goal - Using BCP utility, trying to login to SQL server using Azure Active Directory Username and Password.

Used below command :

bcp tableName out "C:\temp\tabledata.txt" -c -t -S xxxxxxx.database.windows.net -d AzureDB -G -U xxxxxx@xxxxx.com -P xxxxx

Getting below error:

SQLState = FA004, NativeError = 0 Error = [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Failed to authenticate the user 'xxxxxxxx@xxxxxxxxxx.com' in Active Directory (Authentication option is 'ActiveDirectoryPassword'). Error code 0x800401F0; state 10 CoInitialize has not been called.

Any help ?

azure
azure-active-directory
bcp
asked on Stack Overflow Jan 6, 2020 by Krrish

1 Answer

-1

I guess you don't set your public ip address and active directory to access your azure sql server. And please make sure your username and password is correct.

If you don't configure, you will face this error:

enter image description here

Steps how to configure:

  1. allow your public ip address:

enter image description here

2.allow you to use AAD authentication.

enter image description here

answered on Stack Overflow Jan 7, 2020 by Bowman Zhu

User contributions licensed under CC BY-SA 3.0