0

I am trying to connect to MS SQL database via a Spring boot microservice (data source). I have enables MSI on the App service and have tried to follow https://dzone.com/articles/migrating-java-applications-to-azure-app-service-p

This article speaks about simple connection, but we are using spring boot data (JPA) and hence I am unable to configure the correct configuration. I get errors

Failed to obtain JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

If it is MSI enabled, it should not need username/password of database to login.

Has anyone implemented a Spring boot JPA application connecting to MS SQL via MSI.

  • Did you set the AAD admin for your sql server?( i.e the step `Grant MSI identity access to Azure SQL DB` in the doc you mentioned). – Joy Wang Feb 22 '19 at 01:40
  • Yes. I have granted MSI access to Azure SQL as well as enabled MSI on the app service which sets the 2 environmental variables - MSI_ENDPOINT and MSI_SECRET. Database URL is jdbc:sqlserver://name.database.windows.net:1433;database=poc;msiEnable=true;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net; Datasource is SQLServerDataSource and properties set are ServerName, DatabaseName, AccessToken, HostNameInCertificate, ApplicationName and URL); – Sudheendra Singh Feb 26 '19 at 18:57

0 Answers0