I am trying to push data available in bcp files to tables in Azure SQL DB using Managed Identity Authentication method. I want to know if this is possible to authenticate using Access Token.
I am inside a 'System Assigned Managed Identity' enabled VM, and using a PowerShell script, I am able to execute this BCP file using SQL Server Auth and MFA based Auth.
But my main goal is to connect using the Managed Identity Auth (from Azure VM). I am able to retrieve the access token, but I would like to know how to use this token to login to the DB and run the bcp command successfully.
Note: Using Managed Identity Authentication, I am able to connect and query the Azure SQL Database from the Azure VM using Invoke-SqlCmd command, but bcp utility is not working.
Using an Access Token stored in a variable for direct authentication and running BCP commands against an Azure SQL Database using Managed Identity Authentication is not a supported method.
Managed Identity Authentication is typically used for authenticating applications and services running in Azure to access Azure resources securely without the need for storing credentials.
AS per MS document