We want to use AzureSqlServer with ActiveDirectoryMSI authentication as well as token-based authentication and We are able to execute successfully from VM created in Azure network and added as a member of the Azure AD group. For that, we have created Contained user by following the link
And added the VM as part of AzureActiveDirectory by following this link
And we are able to access the SQL data without providing username and password using both IMDS server and able to retrieve the token using http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fdatabase.windows.net%2F
and
ActiveDirectorMSI URIString jdbc:sqlserver://azuresqlserverNAME:1433;databaseName=DatabaseNAME;Authentication=ActiveDirectoryMsi; .
But when it comes to access from Onprem Windows/Linux/Mac machine we are not able to access Azure SQL server
Can someone please suggest to me in terms of on-prem what needs to be done so we can access AzureSqlServer with ActiveDirectoryMSI Authentication as well as token-based authentication?
According to my test, if you want to connect Azure SQL on-premise machine, please refer to the following steps
Add the service principal as Azure SQL database contained user.
Set environment variable. Please set the following variable as the environment variable