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 ?
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:
Steps how to configure:
2.allow you to use AAD authentication.
User contributions licensed under CC BY-SA 3.0